Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Minsk192
Newbie


Joined: 02 Mar 2002
Posts: 7

PostPosted: Tue May 07, 2002 10:01 pm   

C++ question...
 
int main();
char c, name;
void GetName()
{
cout << "** Welcome To Paint-Ball Wars. **n";
cout << "What shall I call you?n", name;
scanf ("%c", &name); // read user's name
cout << "Is " << name << " correct, (Y or N)?n", Name;
cin >> c; // read the user's choice

switch (c) {
case 'Y' : cout << "Hello" << name <<"."; // Get correct name
break;
case 'N' : cout << "Please enter your correct name.", GetName();
break;
default : exit(0);
break;
}
Start();
return 0;
}
---------------------------------------------
I know that the, scanf statement is not right for C++, but if someone knows the correct statement and could tell me, i would really appreciate it. Also, it dosnt seem to be recognizing the %name, value.

-~~~===|!!MINSK!!|===~~~-
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed May 08, 2002 12:53 am   
 
This is not zMUD related. Although I know that many people here might be able and are willing to help you, you need to post this somewhere concerning C++ and not zMUD. Sorry.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net