- #1
rshalloo
- 52
- 0
I'm about to start a module in C++ programming and I was just wondering if the code I learn in college (on P.C's) will be useable on macs Xcode. As in will I be able to EXACTLY the same code on both?
Windowing toolkits, networking, filesystems, even basic input and output depend on the underlying operating system for support. Since most operating systems do pretty much the same thing, this isn't a deal-killer. But every once in a while, you run into problems where some functionality is buggy or just plain undocumented.
jtbell said:Under Windows, you might have to use an extra #include directive at the beginning of a program in order to set up the terminal window
Ivan92 said:It has been my 2nd year using xcode for my C++ class. So far no major problems. However when you learn to open and read from .txt files, you will need to type in the exact location of where the file is at, rather than Windows compilers, where you would just type in the file name(since it expects the file to be in the same folder as the project). So far all good.
jtbell said:Under Windows, you might have to use an extra #include directive at the beginning of a program in order to set up the terminal window
MisterX said:nope
<conio.h> is used for functions like _cgets() and _cputs(). Note that Visual Studio (all versions or at least since VS 2005) broke _cgets(). I've read that using the unicode (16 bit wide character) option may fix this bug. I use Visual C 4.0 or 4.1 to compile old 32 bit programs that use these functions, or Visual C 2.2 to compile old 16 bit programs since _cgets() isn't broke in the older compilers.jtbell said:I remember seeing lots of people posting programs (that they were asking for help with) that had '#include <conio.h>' at the beginning.
Yes, C++ code is generally compatible between Mac and PC. However, there may be small differences in the libraries or compiler used, so some adjustments may need to be made for cross-platform compatibility.
The basic syntax and structure of C++ code is the same on both Mac and PC. However, there may be slight differences in the development environment and tools used, such as the text editor or compiler.
In most cases, C++ programs written on a Mac can be compiled and run on a PC. However, as mentioned earlier, there may be small differences in the libraries or compiler used, so some adjustments may need to be made for cross-platform compatibility.
No, there are no specific limitations to using C++ on either a Mac or PC. However, the overall performance and capabilities of the program may depend on the hardware and operating system of the device it is running on.
You can use the same compiler for C++ on both Mac and PC, such as the popular open-source compiler, GNU Compiler Collection (GCC). However, some developers may prefer to use different compilers for each platform for better optimization or compatibility.