Thread: Linux VS Windows

  1. #1
    Join Date
    Jul 2008

    Linux VS Windows

    Hi, I have a question here. Do the linux codes and windows codes same?

    for example.

    #include <cstdlib>
    #include <iostream>
    using namespace std;
    int main(int argc, char *argv[])
        int (a, b);
    a =3
        return EXIT_SUCCESS;
    what would the code be in linux?
    Last edited by valthyx; 07-21-2008 at 10:01 PM.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Do you mean would you write the C++ code the same in Windows or in Linux? In this case, yes (although it would not look a great deal like the code that you have written). The executables themselves would be different, though.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    The parts of C++ that are standardized are the same on all systems. Portable libraries (many of the Boost libraries) are the same on all systems. Cross-platform libraries (other Boost libraries, wxWidgets, Qt, ...) are the same on a number of systems, but they need to be ported - using platform-specific code - to platforms they don't yet support. System-specific APIs are specific to one system or class of systems. The Win32 API is specific to Windows systems, although the WINE project attempts to provide it for POSIX systems, too.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. windows .dll vs. linux .so - global static objects
    By pheres in forum C++ Programming
    Replies: 11
    Last Post: 11-23-2010, 01:29 PM
  2. Thinking of upgrading to linux...
    By Yarin in forum General Discussions
    Replies: 37
    Last Post: 07-24-2009, 11:40 AM
  3. Build linux on windows
    By baash05 in forum Linux Programming
    Replies: 6
    Last Post: 02-19-2008, 10:12 PM
  4. Why can't Windows run Linux binary executables?
    By Kleid-0 in forum Tech Board
    Replies: 30
    Last Post: 12-04-2005, 11:44 PM
  5. Linux and Windows Duel Boot
    By The15th in forum A Brief History of
    Replies: 7
    Last Post: 04-26-2002, 04:59 AM