What is the difference between turboc, visual studio and online compilers
-
Hi guys, When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
-
Hi guys, When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
Usually because the compilers are different levels, or do not implement the full standards properly. TurboC is very old and most likely allows things that Microsoft's C compiler (not Visual Studio) does not. As to online compilers you would need to check their details.
-
Usually because the compilers are different levels, or do not implement the full standards properly. TurboC is very old and most likely allows things that Microsoft's C compiler (not Visual Studio) does not. As to online compilers you would need to check their details.
-
Hi guys, When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
That happens most likely when using non standard functions from compiler specific libraries (defined in corresponding header files). The Turbo-C and Microsoft compilers are only available for DOS resp. Windows and provide therefore some OS specific functions. Online compilers are usually not OS specific and will therefore only support standard C. The C standard itself has also been changed with time. So recent compilers using a newer standard may issue warnings or errors for code that was tolerable with older standards. However, these compilers usually have an option to compile code using the C89/C90 standard. A short overview of the C standard history:
- K&R, 1978
- ANSI C / C89, 1989
- ISO C / C90, 1990; basically the same as C89
- C99
- C11
So C code conforming to the standards should compile with all compilers supporting that standard and when selecting an older standard if necessary. But code conforming to the C standard is rather rare. Most code will use some OS specific functions like POSIX on Unix systems and the DOS specific functions with DOS/Windows compilers.
-
Hi guys, When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
Jochen Arndt answer is almost spot on. The only thing I would add is on many compilers they have command line flags you can use to set the standard of C you want or need. On GCC compilers for example it's the -std flag .... -std=c89 makes it compile with c89 standard etc. On visual studio it's under the compiler settings options on your project settings. So if you have old code you know the standard it was written with you can just ask the compiler to use that standard. Really old code you can basically guess is going to be C89 and selecting that will remove many of the warnings and errors that won't be accepted by the newer standards. The newer standards stop some old coding styles that were considered dangerous either from the programmer making a mistake or hackers exploiting with things like buffer overruns. The newer standards also have some new features in the language the old syntax won't understand. So if you are writing new code you should write to the newest standard your compiler accepts. If you just need to compile an old code just change the compiler standard back to what you need or else you must correct the code to the newer standard. On large code libraries that can be a daunting task and so usually you take the standard change option.
In vino veritas
-
Jochen Arndt answer is almost spot on. The only thing I would add is on many compilers they have command line flags you can use to set the standard of C you want or need. On GCC compilers for example it's the -std flag .... -std=c89 makes it compile with c89 standard etc. On visual studio it's under the compiler settings options on your project settings. So if you have old code you know the standard it was written with you can just ask the compiler to use that standard. Really old code you can basically guess is going to be C89 and selecting that will remove many of the warnings and errors that won't be accepted by the newer standards. The newer standards stop some old coding styles that were considered dangerous either from the programmer making a mistake or hackers exploiting with things like buffer overruns. The newer standards also have some new features in the language the old syntax won't understand. So if you are writing new code you should write to the newest standard your compiler accepts. If you just need to compile an old code just change the compiler standard back to what you need or else you must correct the code to the newer standard. On large code libraries that can be a daunting task and so usually you take the standard change option.
In vino veritas
-
That happens most likely when using non standard functions from compiler specific libraries (defined in corresponding header files). The Turbo-C and Microsoft compilers are only available for DOS resp. Windows and provide therefore some OS specific functions. Online compilers are usually not OS specific and will therefore only support standard C. The C standard itself has also been changed with time. So recent compilers using a newer standard may issue warnings or errors for code that was tolerable with older standards. However, these compilers usually have an option to compile code using the C89/C90 standard. A short overview of the C standard history:
- K&R, 1978
- ANSI C / C89, 1989
- ISO C / C90, 1990; basically the same as C89
- C99
- C11
So C code conforming to the standards should compile with all compilers supporting that standard and when selecting an older standard if necessary. But code conforming to the C standard is rather rare. Most code will use some OS specific functions like POSIX on Unix systems and the DOS specific functions with DOS/Windows compilers.
-
Hi guys, When i first started learning programming language(ofcourse C!!) in my college I used to practice it on turboc compiler, Now a days we are using visual studio and online compilers and I found myself that the program which is executed in turboc without any error will show up with an error/s or warning/s in visual studio, if I made the necessary corrections to the program in order to execute it in visual studio with out any errors, it show will show up with errors on using online compiler why is that happening??, what is the difference between them??, why couldn't they execute the same program(say C program) which is already error free in other compilers??
Price. (oh, and usefulness)