Thread: Platform Specific...

  1. #1
    Ecologist
    Join Date
    Aug 2001
    Location
    Utah.
    Posts
    1,291

    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.
    Staying away from General.

  2. #2
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Windows programming is almost like its own language. I mean it has its own program structure, its own syntax, its own data types, etc...

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    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
    My best code is written with the delete key.

  4. #4
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    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.

  5. #5
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    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.

  6. #6
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. platform specific API or C standard API
    By George2 in forum C Programming
    Replies: 1
    Last Post: 11-12-2007, 01:32 AM
  2. MinGW Linking GUI Program
    By Tonto in forum Tech Board
    Replies: 19
    Last Post: 08-23-2006, 03:28 PM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Platform specific
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 02-11-2002, 08:25 PM