Mail Archives: djgpp/1997/10/12/20:32:07
Aatu Koskensilta <zaphod AT sci DOT fi> wrote:
> Most C code does (actually, there is very few C programs that won't compile
> as C++ program with no modifications at all), because C is a subset of C++.
<nitpick>
C++ is a superset of C.
</nitpick>
> However, your program uses none of the C++ specific features (such as the
> standard (perhaps some day?:)) io objects cout/cin etc.) and is thus a C
> program. In a sense it also is a C++ program.... I think it's more convinient
> to speak of C programs when none of the C++ specific features are used...
Because such programs are C programs... I think you can only call a program
C++ if it uses features specific to C++. Some things, too, can -only- be called
C programs and not C++ programs; to wit:
int main(void)
{
return(6 / /* comment */ 3);
}
which will compile beautifully as C (well, gcc would require -ansi -pedantic)
but not as C++. I recall seeing more (and more real-world; how many people
actually stick a comment after the divide sign like that? :) examples of this
in comp.lang.c.
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
[- Have a good day, and enjoy your C. -]
- Raw text -