-
Platform Specific...
I don't know where to post this...
What's the difference between programming for DOS and Linux,
and any other OS with C/C++?
I mean, how does the actual process change? In my C/C++ books,
it hardly mentions anything about the OS...
Is it just the compiler you need in order to write a program for
a different OS? I'm assuming there's still a main() function in both
DOS and Linux programs. That's part of the language, right? That
doesn't change (but it changes to WinMain when programming
Windows...?)
Is it just the Libraries that change (which I'm assuming would
come with a different compiler, if there is one)...?
I've never used Linux, and I really haven't started the WinAPI
yet. Still doing DOS/DJGPP stuff... Just curious, though.
-
Windows programming is almost like its own language. I mean it has its own program structure, its own syntax, its own data types, etc...
-
First you must learn what is standard in the languages. The C and C++ standards will specify if something is blatantly wrong for every implementation, otherwise, since if the standard supports something its use should be portable across all implementations, everything that is not mentioned is platform or implementation specific.
-Prelude
-
Most GUI applications are written in an event loop. A console C/C++ program is run more or less top down. A Linux Widget toolkit is similar to a Mac/Windows API however it is a little higher level than those because they rest ontop of Xlib (A minimal API) and they use a window manager which co-ordinates the size and logistics of the windows on the xserver. Linux is more componentized because there is more of a distinction between the client/server. I don't know why you would spend anymore time on DOS, but than again, it doesn't surprise me either.
-
The similarity between windows programming on the different platforms is that they are all about creating controls, buttons, forms, separators, etc. It doesn't matter what OS you are using. You have to learn how to draw the windows and respond to signals. The actual API's all have different names though, but the way the windows are drawn is similar.
-
>What's the difference between programming for DOS and Linux,
>and any other OS with C/C++?
The languages itself don't change. Standard C on Linux is the same as standard C on DOS, SunOS, OS9 or whatever OS. The only difference is the environment. You will use other tools, other libraries, etc. Usually you will note the differences when you go programming on OS level. At that point you have to take the behaviour of the OS into account.
But that actually doesn't have to do with the language itself.
Some compilers offer OS-specific features, like special keywords and constructions to be used on that specific OS, these things are not standard. It is not wrong to use it on that OS, but note that compilation with other compilers and/or on other OS'es may not work.