My first program and it doesn't work.
PHP Code:
#include <iostream>
int main()
{
std::cout << "Enter two numbers:" << std::endl;
int v1, v2;
std::cin >> v1 >> v2;
std::cout << "The sum of " << v1 << " and " << v2
<< " is " << v1 + v2 << std::endl;
return 0;
}
Could anyone tell me what's wrong with that? I've bought a book on C++ and all I get are compiler errors, such as;
"'cout' is not a member of 'std'"
"'endl' is not a member of 'std'"
"'cin' is not a member of 'std'"
"'cout' is not a member of 'std'"
Obviously this is related to the 'std'. I've seen online tutorials not use the 'std' at all. Basically what I want to know is how I could fix that program, what 'std' is all about and finally why 'std' is used in some tutorials and not others.
Any help will be much appreciated. :)