Mail Archives: djgpp/1998/09/09/18:40:57
> > Isn't *.C considered a C++ file and *.c considered a C
> > file? Or is this just in UNIX?
> >
> > --JASON--
>
> I don't think it's in unix, (I haven't found any yet)
You lost me here - found any what? (BTW - that is true for UNIX cc)
> and it can't be in dos because dos makes no distinction
> between upper and lower case letters.
Something interesting here - I tried making two identical files:
test.C and test2.c <---- (Note case of extensions)
They both contained this code:
//---------------
#include <iostream.h>
int main(void)
{
cout << "\n\nThis is a test!!!\n\n\n";
}
//---------------
(C++ source)
I tried compiling from the command line:
gcc -c test.C
and it worked. I then tried to compile the other:
gcc -c test2.c
and it said it couldn't find the file "iostream.h". This is because it
recognizes it as lowercase and as a C source, an not C++. It worked for the
other file because it recognized it as uppercase, and it made the
distinction. This caught me by surprise, since my original belief was, like
you said, DOS doesn't distinguish between upper an lower case. Hmm...
--JASON--
- Raw text -