-
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?
-
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.
-
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.