What's the difference between...

Started by
2 comments, last by Namir 18 years, 5 months ago
I'm not a great C++ programmer to start with, but I've always been taught how to do it on Windows. I'm working on a few things that will need to run on Linux, and I am wondering just what the differences are between C++ on Windows and C++ on Linux. What should I look out for, how are programming standards different, and are there any (good) newbie-friendly resources I can look at? I'm not too knowledgable of Linux, either, so don't try tell me go change something without giving me instructions on how to do it. :) All part of my hey-you-need-to-broaden-your-horizons personal project.
Advertisement
C++ is C++, the main things that are a pain are the differences in compilers, IDEs, makefiles, etc...
The language is the same. However, it's important to understand that the language itself doesn't really do anything useful, like printing stuff, seeing where the mouse is, creating a window, getting input, etc. The C++ standard library (which is also the same) does a little of that, but not much. It's sort of a lowest common denominator. In order to do things like graphics, you will be going beyond bare C++ and into platform-specific stuff. Libraries like SDL exist to make platform-specific stuff work across several platforms; if you're interested in your programs working across different platforms, and you're willing to do some extra work to accomplish that, check out SDL.

Tutorials which do not do graphical stuff, and instead stick to I/O via cin and cout, will generally work on any platform. Of course, you still have to figure out how to set up your build environment to compile and link them properly, which can be a royal pain in the tuckus. We can help, though, and also googling any errors you get will almost always turn up useful information.
Yeah.

I've heard nasty things about whitespaces and line returns, mostly. But I was concerned about jumping over to my Linux computer (which doesn't have the internet, which makes it extremely inconvient), start programming away, and find, "Hey... I have no idea what I'm doing now."

Edited to add:
I'm not going to be worrying about graphics and GUI stuff. For that, there is Java. :) Or atleast, I hope there is Java. Mostly, I am going to be practicing C++ for a while, and then try to build a text-based game with it.

This topic is closed to new replies.

Advertisement