I recently see people using .cxx file to develop in C++. Is there
anybody who know the difference between using a .cpp file and .cxx
file (Windows)?
Thanks
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Leslie
> I recently see people using .cxx file to develop in C++. Is there
> anybody who know the difference between using a .cpp file and .cxx
> file (Windows)?
There isn't really one. Some compilers refuse to compile files with an
invalid suffix (cpp, cxx, C and C are usually safe), but that's about
it. As long as you keep consistent, there shouldn't be an issue.
--
_ _
/'< Troels "Athas" Henriksen >'\
/_v/ "In void* we trust." \v_\
I doubt there is a difference, other than local convention.
In the olden days, there was no established convention. Some people used
"xx" because it looks a bit like "++"; they didn't want to use actual "++"
because of potential problems (eg if the local commandline shell uses +
for regular expressions). I've not seen it recently, but I daresay this
convention persists.
-- Dave Harris, Nottingham, UK
> > I recently see people using .cxx file to develop in C++. Is
> > there anybody who know the difference between using a .cpp
> > file and .cxx file (Windows)?
> There isn't really one. Some compilers refuse to compile files
> with an invalid suffix (cpp, cxx, C and C are usually safe),
> but that's about it. As long as you keep consistent, there
> shouldn't be an issue.
.C is not necessarily safe. On a system where filenames are
case insensitive, the compiler will normally compiler .C as a C
file, not a C++ file.
All compilers I know of also have an option to allow explicit
specification of the language. Thus, in VC++, /Tp, or with g++,
-x c++, will ensure that the next (or following, in g++) files
will be considered C++, regardless of their extension.
--
James Kanze GABI Software http://www.gabi-soft.fr
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Also .cpp was also sometimes used for cpp (C preprocessor).
I have always used .cxx, .hxx, .ixx, .lxx, .yxx and .txx (for C++ coded
code, header, inline, lex, yacc and template files). I used to also use
something like .rxx for input to rpcgen.
Only occasionally did a compiler not accept the .cxx.
JK