ultrashawn18
Beta member
- Messages
- 2
Hello I was wondering if there is a way to store a series of letters, such as a name. I at first tried to use "char" however this only stores one charecter. here is just a simple program I was trying to write which I had hoped would store the Candidate's name and initals.
//just a lil program w00t 05 tho
#include<iostream.h>
int main()
{
double can1=25;
double can2=57;
double can3=52;
/* I am definig everything im suppose to in the book */
char cand1='Mike Presely', can1b='MP';
char cand2='Sue Farted', can2b='SF';
char cand3='Barnes Nobles', can3b='BN';
int year;
year = 2000;
cout<<"The current results for the "<< year <<" election is as follows\n\n";
cout<<cand1<<", "<<can1b <<" ..... " <<can1<<"\n"; //this will hopefully display the results for the first candidate of the election
cout<<cand2<<", "<<can2b <<" ..... " <<can2<<"\n";
cout<<cand3<<", "<<can3b <<" ..... " <<can3<<"\n";
cin.get();
return(0);
}
I know the answer may be really simple but I did search the forums and look in Dev-C++ help before asking. Anyway anyhelp is greatly aprecaited.
//just a lil program w00t 05 tho
#include<iostream.h>
int main()
{
double can1=25;
double can2=57;
double can3=52;
/* I am definig everything im suppose to in the book */
char cand1='Mike Presely', can1b='MP';
char cand2='Sue Farted', can2b='SF';
char cand3='Barnes Nobles', can3b='BN';
int year;
year = 2000;
cout<<"The current results for the "<< year <<" election is as follows\n\n";
cout<<cand1<<", "<<can1b <<" ..... " <<can1<<"\n"; //this will hopefully display the results for the first candidate of the election
cout<<cand2<<", "<<can2b <<" ..... " <<can2<<"\n";
cout<<cand3<<", "<<can3b <<" ..... " <<can3<<"\n";
cin.get();
return(0);
}
I know the answer may be really simple but I did search the forums and look in Dev-C++ help before asking. Anyway anyhelp is greatly aprecaited.