At 08:22 AM 08/06/2001, Jeff Trawick wrote:
>(this may be my lack of Visual Studio 5.0 skills, but anyway...) I
>just tried to create a new C file and there wasn't such a thing on the
>menu. I can create a "C/C++ Header File" or a "C++ Source File."
Use C++ Source File, and name the file something.c. If you leave off
the extension, it will make it .cpp. (That's basically all that
selection does, except for certain types it will insert some
boilerplate text, like for .html files.)
> From the command-line (cl.exe) I tried to compile something like
>
> int main(void) { char x; x = 0; char y; y = 1; return 0; }
>
>and it failed if the file was named test.c and it succeeded if the
>file was named test.cpp.
That is the expected behavior. The file is compiled using C rules if
the file extension is .c.
>I wonder if newer levels of Visual Studio or the compiler itself
>aren't doing the right thing (or there is something in/missing from
>the project file which tells it to treat everything as c++...
The same behavior is in VC6. I don't know of any way to force C++
behavior on all files, even .c files.
--
Greg Marr
[EMAIL PROTECTED]
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"