Starting to learn c++
I need just a little help getting started.. I'm understanding most of it *not that I'm far or anything*. But I don't get the braces.
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
Why couldn't I use a semicolon after int main and cin.get... Instead of using the braces.. Is it because int main is a function thus requires the braces.. And cin.get is that because its a function, but why does it have the semicolon then if its already ended. I actually get the rest of that...cout...#include <iostream>..etc...
I know I'm a complete newb, but hey we all had to start somewhere, and this tut. does seem pretty good just isn't quite clear on this.
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
Why couldn't I use a semicolon after int main and cin.get... Instead of using the braces.. Is it because int main is a function thus requires the braces.. And cin.get is that because its a function, but why does it have the semicolon then if its already ended. I actually get the rest of that...cout...#include <iostream>..etc...
I know I'm a complete newb, but hey we all had to start somewhere, and this tut. does seem pretty good just isn't quite clear on this.