Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File name ending...

Status
Not open for further replies.

Matt53

Technical User
Jun 18, 2005
1
CA
I know C++ But what is the file ending of it... Like for html its .html can anyone help me please?
 
If you keep to Microsoft it is .h for the headers and .cpp for the source files.

Some places use .hxx and .cxx
Other places use .H and .C but you'll have to make sure /Tp is set on your compiler otherwise it takes .C as .c i.e. C instead of C++.

Some places use combinations of the above. There is no standard.
 
.cc is also another common extension and for headers .hpp is sometimes used
 
You can find C++ libraries where headers have no file extension. STL headers follow this, like <iostream> or <vector> for example. This is also the way trolltech rename headers of Qt4's classes, like <QApplication> or <QTextEdit>. Generally such files are headers aliases.

--
Globos
 
Name it whatever you want as long as you can tell your compiler what it is:
Code:
$ cat <<EOF >waffle.moo
> int main() {}
> EOF
$ gcc -xc++ waffle.moo -o waffle
$ ./waffle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top