Everything2
Near Matches
Ignore Exact
Full Text
Everything2

C++: standard names for source files

created by ariels

(idea) by ariels (1 d) (print)   ?   (I like it!) 1 C! Sun Jan 07 2001 at 9:15:54

Every programming language has a standard for naming its source files. Python does .py, Prolog (along with Poland and perl4) does .pl, C does .c for source and .h for interface, sh does .sh.

What about C++? Well, if ever you see any of the following extensions, know you're onto a C++ file (sorry, translation unit). Well, at least you might be...

NOTE: This list makes no pretenses of completeness!

  • .h for header files. No, really! Until the latest ISO C++ standard, the official approved way for standard headers was to steal the C name. Then they switched to something really ugly.
  • .cpp for source, .hpp for interface.
  • .cc for source. We usually don't use .hh for interface, that's just plain silly.
  • .C for source. No, not .c, we'd never dream of encroaching on another language's extension-space. Unless it's objective C, which, frankly, we don't regard as a language which exists. Although Objective C weenies claim their source code extension is .m. Maybe we can steal .m?

    BTW, that's a .C, with a Capital C. Oh, and .H for interface is Not Done. Dunno why.

  • .c++ for source, .h++ for interface (as before, the latter is less common).
  • .cxx for source, .hxx for interface. You see, we wanted to use .c++ and .h++, but our file system doesn't let us.

printable version
chaos

The C++ Programming Language Freakshow Objective-C ISO standard cup of tea A Mole Is a Unit
.m .cc 10 steps to becoming a Perl Ninja The Objective Observer and other myths
Extreme Programming Objective C Type Encoding The truth about pennies C++: function templates and information hiding
ISO Standard Supermarket Objective Individual Combat Weapon (OICW) AdaOS .h
Objective C messaging C/C++ headers file system Standard deviation from the median
Las Vegas call girl phone phreak conspiracy binary Tool of Objective Truth Conflict of objectives
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Look at this mess the Death Borg made!
Gentrification
XML
Mutant brains of London cabbies
For a boat of white bone, and we three
Anglo-Saxon Laws and Customs
How the Alphabet Began
Henry V
Historiography
Ash Wednesday
In Taberna
Celtic Mythology
Brahman and the fractal nature of the universe due to the chaotic nature of string theory
Lucid dream
New Writeups
Glowing Fish
Tualatin River(place)
The Jacket
Words of Advice(idea)
keepinitreal
Why buy the cow when you can get the milk for free?(idea)
John_Fox
Good Intentions Gone Wrong(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
This page courtesy of The Everything Development Company