Linux VS Windows

This is a discussion on Linux VS Windows within the C++ Programming forums, part of the General Programming Boards category; Hi, I have a question here. Do the linux codes and windows codes same? for example. Code: #include <cstdlib> #include ...

  1. #1
    1337
    Join Date
    Jul 2008
    Posts
    135

    Linux VS Windows

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

    for example.

    Code:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        
        int (a, b);
    
    a =3
    b=2
    
    cout<<a+b<<endl;
    
        
        
        cin.get();
        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
    Posts
    14,185
    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
    Posts
    8,893
    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!
    CornedBee

    "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, 12: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, 09: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, 10:44 PM
  5. Linux and Windows Duel Boot
    By The15th in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-26-2002, 04:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21