Hi..
Please can you point me out a bit here. Sorry if its obvious to those in the know but I am lost even with searching loads of forums.
I have started to learn c++ and at the moment I am using OSX. Now it might be a mistake as I think I have found life much easier in Windows.
I have downloaded the Xcode, and through recommendations have also used Eclipse.
There are many Hello World programs around the net but for some reason anything compiling with <iostream> fails
ie:
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
This is the standard C++ hello world program but wont compile on a mac??? Using any of the ways I have tried. Either in Eclipse, using Xcodes interface or through command line using the "C++" command.
However this works:
#include <stdio.h>
int main(void) { printf(\"Hello world\"); return 0; }
Now I am new at this but I cannot find sensible answers around when others ask about this problem other than people suggesting stuff is either missing or
odd. But this would be the same situation for any noobie learning to program on a mac currently as my install of this stuff is all fresh.
What I am concerned with is I want to get a book soon to dive into this topic and spend time learning the code properly but if the basic building blocks of C++ are somehow missing in Xcode I need to consider learning on a Windows based PC instead, which I was hoping would not be the case.
Can anyone clear this up for me.
Please can you point me out a bit here. Sorry if its obvious to those in the know but I am lost even with searching loads of forums.
I have started to learn c++ and at the moment I am using OSX. Now it might be a mistake as I think I have found life much easier in Windows.
I have downloaded the Xcode, and through recommendations have also used Eclipse.
There are many Hello World programs around the net but for some reason anything compiling with <iostream> fails
ie:
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
This is the standard C++ hello world program but wont compile on a mac??? Using any of the ways I have tried. Either in Eclipse, using Xcodes interface or through command line using the "C++" command.
However this works:
#include <stdio.h>
int main(void) { printf(\"Hello world\"); return 0; }
Now I am new at this but I cannot find sensible answers around when others ask about this problem other than people suggesting stuff is either missing or
odd. But this would be the same situation for any noobie learning to program on a mac currently as my install of this stuff is all fresh.
What I am concerned with is I want to get a book soon to dive into this topic and spend time learning the code properly but if the basic building blocks of C++ are somehow missing in Xcode I need to consider learning on a Windows based PC instead, which I was hoping would not be the case.
Can anyone clear this up for me.