Jul 29, 2012 at 7:43am UTC
I program apps for windows but recently I've started developing for Mac OS X Mountain Lion using Xcode 4.4. But for some reason, it won't accept the most simple C++ app, Hello World!
Here's the code it gave me:
int main(int argc, const char * argv)
// insert code here...
std::cout << "Hello, World!\n";
Heres the code I wrote:
cout << "Hello, World!\n";
Jul 29, 2012 at 8:12am UTC
Also you need to write
in order to use cout. using namespace std;
PS: What does this have to do with C++ vs C++11?
Last edited on
Jul 29, 2012 at 8:13am UTC
Jul 29, 2012 at 10:31am UTC
Sorry, I did write
using namespace std;
but forgot to mention it. When I was downloading Xcode in the description it said something like
Could you also just highlight some difference between C++ and C++11?
Last edited on
Jul 29, 2012 at 10:33am UTC
Jul 29, 2012 at 10:55am UTC
C++ is the language. C++11 is the name for the latest version of C++, so C++11 is still C++. Older versions are C++98 and C++03.
Jul 29, 2012 at 12:33pm UTC
Is there any differences in the code? Or maybe does it add new libraries etc?
Jul 29, 2012 at 1:41pm UTC
Yes, it add new libraries and language features. However, you should not be your concern, as you are a beginner, so likely you don't use them anyway.
Jul 30, 2012 at 7:08am UTC
There are differences in the code ONLY if you want them! Very little stuff is removed, mostly added. Sure, now there are easyer ways to do some stuf, but everything that worked before, works now.