MTT:
Read the input in like so ...
char szpName[256];
gets(szpName);
Also change the cout in the TextOutput function to puts() and have the TextOutput function take a char instead of the std: stuff.
I'm pretty sure that will work, although I can't test it because my complier keeps crashing on me today.
[edited by - tiffany_smith on February 24, 2004 8:27:18 PM]
Getting a players name
since you are using the win32 api, your input and output functions should be win32 api, not iostream.
EvilCrap: The name is supposed to go after the colen, I am using win32 console. And doesnt getche only get 1 char?
Tiffany_Smith: I tried making it an array and using gets(szpName), and it just jumped to the next part of the game before i could write anything.
DerAnged: i tried using gets(str.c_str());, and i couldnt get it to work, if you could show me what i would look like with szpName (i kinda couldnt figure out where to put it) then it might work, i dont know.
Tiffany_Smith: I tried making it an array and using gets(szpName), and it just jumped to the next part of the game before i could write anything.
DerAnged: i tried using gets(str.c_str());, and i couldnt get it to work, if you could show me what i would look like with szpName (i kinda couldnt figure out where to put it) then it might work, i dont know.
MTT: As Evil said, you need to use the win32 api read and write functions.
Edit: Wrong links, I'll quit while I'm not too far behind.
[edited by - tiffany_smith on February 24, 2004 8:50:44 PM]
Edit: Wrong links, I'll quit while I'm not too far behind.
[edited by - tiffany_smith on February 24, 2004 8:50:44 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement