943,506 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 213703
  • C++ RSS
Aug 30th, 2003
0

C++ cout statement

Expand Post »
// This program will write the name, address, telephone number
// and college major of the programmer.

// Michael Hawkinberry

#include <iostream>
using namespace std;

int main()
{

cout << " Michael Hawkinberry\n6393 Harlem-Grovetown Road, Harlem, Georgia, 30814\n(706) 556-3731\nComputer Science " << endl;
return 0;
}
Is this program error free? if there are errors could u send them to me?? thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Msh84281 is offline Offline
1 posts
since Aug 2003
Aug 30th, 2003
0

Re: C++

Yeap, it looks fine to me. If I were you I wouldn't be publically displaying your name, address, and phone # on a public forum ... if that is your real contact info, that is.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is online now Online
13,645 posts
since Feb 2002
Sep 14th, 2003
0

the c++ problem

Well I think I have some problems to solve for myself.As csegirl tells that there is nothing wrong with the program.I think I have something wrong with my compiler so that's why i'm posting a message here.If I am not wrong,the source code is like this:
//This program will write the name,address,telephone number
// and college major of the programmer
// Michael Hokinberry
#include <iostream>
using namespace std;
int main()
{
cout << " Michael Hokinberry\n 6393 Harlem-Grovetown Road,Harlem,Georgia,30814\n (706) ,556 - 3731\nComputer Science " << endl;
return 0;
}
At first,I tried to run this with my compiler and it said that it couldn't find the iostream file.
Then,there were three errors when I tried with iostream.h:
harlem.cpp(5):error c2501: 'using' missing decl-specifiers
harlem.cpp(5):error c2239: Unexpected token 'identifier' following declaration of 'using'
harlem.cpp:error c2061: syntax error identifier 'namespace'
I'm really mad at my compiler now...
Reputation Points: 16
Solved Threads: 2
Posting Whiz in Training
camelNotation is offline Offline
208 posts
since Sep 2003
Sep 16th, 2003
0

Re: the c++ problem

What compiler are you using?
Ilya
P.S.: Can anybody please check out my "string to integer array" problem?
Reputation Points: 13
Solved Threads: 0
Junior Poster in Training
Valmian is offline Offline
82 posts
since Sep 2003
Sep 17th, 2003
0
Re: C++ cout statement
When I installed the c++ in my hard disk it said "c/c++7".If you have not noticed yet,this compiler couldn't execute the static_cast statement,for casting integers to floats.But It succeded when I used float x = ( float ) y...I need to know whether I can run my c++ source codes in visual studio.net or visual c++ .net or whatever you call it...
Reputation Points: 16
Solved Threads: 2
Posting Whiz in Training
camelNotation is offline Offline
208 posts
since Sep 2003
Sep 17th, 2003
0

Re: C++

you can compile your code with visual studio .net . In fact, I think that is the best non gcc IDE compiler for windows.
Reputation Points: 13
Solved Threads: 0
Junior Poster in Training
Valmian is offline Offline
82 posts
since Sep 2003
Jul 29th, 2004
0

Re: C++

Hello,

I am wondering what the "using namespace std;" statement is all about. I have never seen it, yet have done the "hello world" program as coded above many times.

Christian
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004
Jul 29th, 2004
0

Re: C++

>I am wondering what the "using namespace std;" statement is all about.

It's a modern, standard C++ (as opposed to old, pre-standard C++) way to use an unadorned cout (for example), which is a member of the std namespace. Here are a few more details.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: pow: DOMAIN error
Next Thread in C++ Forum Timeline: Displaying a League Table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC