| | |
C++ cout statement
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2003
Posts: 1
Reputation:
Solved Threads: 0
// 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
// 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
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.
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...
//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...
0
#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...
>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.
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.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- Why Doesnt this simple Cout statement work?? (C++)
- If Statement / Loopwhile advice (C++)
- Well-formed cout statements. Help appreciated. (C++)
- Strange cout problem (C++)
- Using a switch statement with nested if/else statements (C++)
- printf & cout (C)
- Java (C++)
Other Threads in the C++ Forum
- Previous Thread: pow: DOMAIN error
- Next Thread: Displaying a League Table
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets







