Create a design for a program that displays the message "Hello World" and do not define it using namespace std.
How would i go about doing this. A friend and I have looked into it as why one would code this without using namespace std.
Hello world was my first C++ program and I know how to do it but i do not know how to code it without using namespace std.
Any help please?
3 Replies - 1314 Views - Last Post: 24 November 2010 - 12:37 AM
#1
Hello World program but cannot use using namespace std
Posted 23 November 2010 - 09:43 PM
Replies To: Hello World program but cannot use using namespace std
#2
Re: Hello World program but cannot use using namespace std
Posted 23 November 2010 - 09:53 PM
Well, you should try googling it (namespace std). Understand what the namespace does for you, and how the same thing can be accomplished with out using it.
#3 Guest_joseph*
Re: Hello World program but cannot use using namespace std
Posted 23 November 2010 - 11:16 PM
This should work...
#include <iostream>
using std::cout;
using std::endl;
int main()
{
cout<<"Hello World"<<endl;
}
#4
Re: Hello World program but cannot use using namespace std
Posted 24 November 2010 - 12:37 AM
That is kinda like telling someone not to use the word hi, and they use hello instead, more a smart-ass move.
Besides, don't feed him the answer, let him try to work it out. If he is really interested in learning, and doesn't figure it out, he can come back here for more help.
I googled the term "namespace std" and the first result just about gave me all I needed to figure out how to use cin and such, without using namespace std, the third result handed me the answer.
Besides, don't feed him the answer, let him try to work it out. If he is really interested in learning, and doesn't figure it out, he can come back here for more help.
I googled the term "namespace std" and the first result just about gave me all I needed to figure out how to use cin and such, without using namespace std, the third result handed me the answer.
This post has been edited by Gorian: 24 November 2010 - 12:40 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|