So i'm learning c++ by reading a book, and i started messing around with the code. This is how it usually looks like:
{
using namespace std; //for cout
std::cout << "How are you?"; //writes to display
std::cout << std::endl; //goes to next line
std::cout << "I'm fine atleast"; //writes to display
cin.get(); //makes the program stay on the screen until enter is pressed
return 0; //terminate main
}
Now that seems perfectly fine which it is, now why does this work?
{
using namespace std; //for cout
std::cout << "How are you?"; //writes to display
std::cout << std::endl; //goes to next line
std:cout << "I'm fine atleast"; //writes to display
cin.get(); //makes the program stay on the screen until enter is pressed
return 0; //terminate main
}
I removed one of the : from the std:cout << "I'm fine atleast";
I tried to remove it from any of the other std::cout but then the build got errors, someone please explain
