- #1
vociferous
- 253
- 6
I am starting a programing class for scientists and engineers at the end of the month. I wanted to brush up on my C. I used to compile C programs with Visual Studio, but now that no longer seems to work. Even simple example programs in the book generate a litiney of compile errors in Visual Studio (using the Win32 console type application)
For example:
Error 1 error C2065: '"Goodbye' : undeclared identifier c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 2 error C2065: 'cruel' : undeclared identifier c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 3 error C2146: syntax error : missing ')' before identifier 'world' c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 4 error C2017: illegal escape sequence c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 5 error C2059: syntax error : ')' c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Now, I thought that C was supposed to be an ANSI standard and that all C++ compilers were supposed to be able to handle it. Does Visual C++ not conform to that standard or am I just doing something wrong?
For example:
#include <stdio.h>
int main()
{
printf("Goodbye, cruel world!\n");
return(0);
}
generates the following compile errors:int main()
{
printf("Goodbye, cruel world!\n");
return(0);
}
Error 1 error C2065: '"Goodbye' : undeclared identifier c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 2 error C2065: 'cruel' : undeclared identifier c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 3 error C2146: syntax error : missing ')' before identifier 'world' c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 4 error C2017: illegal escape sequence c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Error 5 error C2059: syntax error : ')' c:\documents and settings\administrator.minerva.000\my documents\visual studio 2005\projects\goodby world\goodby world\goodby world.cpp 11
Now, I thought that C was supposed to be an ANSI standard and that all C++ compilers were supposed to be able to handle it. Does Visual C++ not conform to that standard or am I just doing something wrong?