In reference to the std:: vs using namespace std;
with the using namespace std, you are telling that compiler to look in the std namespace for functions. By using std:: you are stated to look in the std namespace for this specific function.
BoyWunder
function trouble, need alittle help understanding
You could have also put the ''std::'' lines after your include statement, then just used cin and cout. Like this:
#include <iostream>
using std::cin;
using std::cout;
int main()
int age;
{
cin >> "Enter your age: " >> age;
cout << "\nYour age is: " << age;
return 0;
}
#include <iostream>
using std::cin;
using std::cout;
int main()
int age;
{
cin >> "Enter your age: " >> age;
cout << "\nYour age is: " << age;
return 0;
}
awesome, I didn''t know you could use
using std::cin & using std::cout
that''s cool.
could you do it like this?
using std::cin, std::cout;
using std::cin & using std::cout
that''s cool.
could you do it like this?
using std::cin, std::cout;
quote:Original post by germpest
could you do it like this?
using std::cin, std::cout;
Try it. If it doesn''t compile, you can''t do it. If it does compile, you can.
I don''t like "can I do this?" questions very much, because it''s often simply a matter of making a test application, which you can usually do in a few minutes.
I''ll tell you anyway though, just cause I''m in that kind of mood: No. Don''t believe me? Try it
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement