User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,975 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,758 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 93539 | Replies: 7
Reply
Join Date: Aug 2003
Posts: 1
Reputation: Msh84281 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Msh84281 Msh84281 is offline Offline
Newbie Poster

Help C++ cout statement

  #1  
Aug 30th, 2003
// 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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 11,019
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 33
Solved Threads: 116
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: C++

  #2  
Aug 30th, 2003
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.
Reply With Quote  
Join Date: Sep 2003
Location: deep withing 100100010100
Posts: 201
Reputation: camelNotation is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 1
camelNotation's Avatar
camelNotation camelNotation is offline Offline
Posting Whiz in Training

Help the c++ problem

  #3  
Sep 14th, 2003
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...
Reply With Quote  
Join Date: Sep 2003
Location: San Diego, CA, USA
Posts: 75
Reputation: Valmian is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 0
Valmian Valmian is offline Offline
Junior Poster in Training

Re: the c++ problem

  #4  
Sep 16th, 2003
What compiler are you using?
Ilya
P.S.: Can anybody please check out my "string to integer array" problem?
Reply With Quote  
Join Date: Sep 2003
Location: deep withing 100100010100
Posts: 201
Reputation: camelNotation is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 1
camelNotation's Avatar
camelNotation camelNotation is offline Offline
Posting Whiz in Training
  #5  
Sep 17th, 2003
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...
Reply With Quote  
Join Date: Sep 2003
Location: San Diego, CA, USA
Posts: 75
Reputation: Valmian is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 0
Valmian Valmian is offline Offline
Junior Poster in Training

Re: C++

  #6  
Sep 17th, 2003
you can compile your code with visual studio .net . In fact, I think that is the best non gcc IDE compiler for windows.
Reply With Quote  
Join Date: Mar 2004
Posts: 1,514
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Rep Power: 10
Solved Threads: 49
Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: C++

  #7  
Jul 29th, 2004
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
Reply With Quote  
Join Date: Apr 2004
Posts: 3,755
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 17
Solved Threads: 147
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: C++

  #8  
Jul 29th, 2004
>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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 9:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC