www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/09/18:40:57

Message-ID: <77349FC5DC1CD211BAD900805FA7241A62DADC@es01snlnt.sandia.gov>
From: "Saavedra, Jason Paul" <jpsaave AT sandia DOT gov>
To: "'Allens'" <allen DOT asjp AT cableol DOT co DOT uk>,
"'djgpp AT delorie DOT com'"
<djgpp AT delorie DOT com>
Subject: RE: Newbie Question regarding include
Date: Wed, 9 Sep 1998 16:40:16 -0600
MIME-Version: 1.0

> > 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019