Is there any way to change the settings of VC++ so it compiles only in C, nothing about c++ is allowed in my assignment? this would help a lot!
Is there any way to change the settings of VC++ so it compiles only in C, nothing about c++ is allowed in my assignment? this would help a lot!
dun think so, writing the code in c and compile with a c compiler
Try encapsulating the function prototypes in your .h file with...
I'd suggest looking up "__cplusplus" or "extern "C"" in the help files that come with MSVC++ just in case. This is from some relatively old code that a friend of mine wrote and I think it may be MSVC++ specific.Code:#ifdef __cplusplus extern "C" { #endif int myFunc(char *myString); /* more prototypes here */ #ifdef __cplusplus } #endif
naming the file with a .c extention not a .cpp should work.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
Or you can use the /TC compiler option to compile all files as C regardless of the extension.
no_one has the right idea,
create a new text file and immediately rename it with a .c extension, create a new workspace ( I've only ever used the Simple Console Application setting!) and paste the .c file in the code window and start coding.
The /TC thing sounds great, but us newbies need to be told how to do it and also how to change it back if we ever 'graduate' to C++ programs!
Cheers,
foffo