P PsychicFreak Member Joined Jun 6, 2008 Sythe Gold 0 Messages 53 Jul 4, 2010 #1 how do i make output name in using dev-c++ pls help
B blindkilla Guru Joined Jun 22, 2005 Sythe Gold 6 Messages 1,896 Location Canada Jul 5, 2010 #2 Include the header file: Code: #include <iostream> and then use: Code: cout << "my name" << endl;
Barz Apprentice Joined May 24, 2010 Sythe Gold 0 Messages 753 Jul 6, 2010 #3 blindkilla said: Include the header file: Code: #include <iostream> and then use: Code: cout << "my name" << endl; Click to expand... also with my IDE have to have another header file for it to compile, not sure if the OP'er needs it also Code: #include <cstdlib> also maybe hes trying to make a program that asks your age and displays it? if so Code: #include <string> string myname; cout<<"What is your name"<<endl; cout<<"Your name is"<<" "<< myname<<"."<<endl; system("PAUSE"); return EXIT_SUCCESS;
blindkilla said: Include the header file: Code: #include <iostream> and then use: Code: cout << "my name" << endl; Click to expand... also with my IDE have to have another header file for it to compile, not sure if the OP'er needs it also Code: #include <cstdlib> also maybe hes trying to make a program that asks your age and displays it? if so Code: #include <string> string myname; cout<<"What is your name"<<endl; cout<<"Your name is"<<" "<< myname<<"."<<endl; system("PAUSE"); return EXIT_SUCCESS;
ET Phone Home Apprentice Joined Sep 8, 2008 Sythe Gold 0 Messages 663 Jul 13, 2010 #4 Barz said: also maybe hes trying to make a program that asks your age and displays it? if so Code: #include <string> string myname; cout<<"What is your name"<<endl; cout<<"Your name is"<<" "<< myname<<"."<<endl; system("PAUSE"); return EXIT_SUCCESS; Click to expand... You'd of course need to include a cin >> myname; after the first cout... seeing as most peoples' names aren't a random string of numbers or characters from leftover uses of the variable 'myname.' Lol
Barz said: also maybe hes trying to make a program that asks your age and displays it? if so Code: #include <string> string myname; cout<<"What is your name"<<endl; cout<<"Your name is"<<" "<< myname<<"."<<endl; system("PAUSE"); return EXIT_SUCCESS; Click to expand... You'd of course need to include a cin >> myname; after the first cout... seeing as most peoples' names aren't a random string of numbers or characters from leftover uses of the variable 'myname.' Lol