I need help with C++ ( mac user)

How come C++ in Xcode looks so different than regular c++ on windows or code::block

The first code is from Xcode and the second is from code::block
whats up with the n"; after "hello world" but that not there in the second code

1
2
3
4
5
6
7
  #include <iostream>

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}




1
2
3
4
5
6
#include <iostream>

int main()
{
    std::cout << "Hello World!";
}
\n just means you want a new line. So if you would write after the \n it would appear on a new line, try it yourself.

int argc, const char * argv[]
This stuff is just optional, you dont need it at all. I don't exaftly know what you can use it for but Im sure you can google it.
Topic archived. No new replies allowed.