Hello
Could anyone tell me how you make my programs independent of the compiler?
I haven't been doing this too long but none of the programs I have made work unless opened with MS Visual C++ 6 which is what I used to make them.
Any clues?
Hello
Could anyone tell me how you make my programs independent of the compiler?
I haven't been doing this too long but none of the programs I have made work unless opened with MS Visual C++ 6 which is what I used to make them.
Any clues?
Unfortuneately what you want is nigh on imposssible. I do not know of any compiler that is fully ANSI compliant. Every compiler has its quirks. You can program in ANSI c++ and at best hope that your code will compile on other compilers without changes.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
>>> I do not know of any compiler that is fully ANSI compliant.
Ain't that the truth!
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
well if you want to write code to work on multipul compilers and platforms, then you have to put precompiler statements saying which one is going to be compiled. ie:
#define UNIX 2
#define MSVC 1
#define BORLAND 3
#define PLATFORM = UNIX
#if PLATFORM == MSVC
//.. DO SOME CODE
#endif
#if PLATFORM == UNIX
//.. do some code
#endif
#if PLATFORM == BORLANDC
//.. do some code
#endif
if you compiled it then it would invoke only the UNIX code when it sends through the pre-processor.
hope that answers your question