c++ in Xcode

Hey guys I am beginning to program in c++, i am using xcode as an IDE (i am a mac user) and I know how to set up a project, but when I debug my project it says my line of code is correct but nothing pops up. (The only other language I know well is Visual basic and were learning that in school.)

I named the project "Hellowordl"
Here is my code

#include <helloworld.h>
main()
{
cout << "Hey, YOU, im alive and Hello World!";
return 0;
}

help would be appreciated
Last edited on
You need to set a breakpoint on the first line of your code and then step through it. BTW you need to declare your main(...) as follows:

 
int main()


or if you are going to pass arguments in as:

 
int main(int argc, char* argv[])


as you return an int back to the OS to flag the state in which your program ended, 0 flags to the OS that all was ok, and != 0 flags an error occurred.
Topic archived. No new replies allowed.