Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++ Help Needed] Solved

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
zhanfeng123
How do I cheat?
Reputation: 0

Joined: 20 Jan 2008
Posts: 9

PostPosted: Tue Dec 23, 2008 7:36 pm    Post subject: [C++ Help Needed] Solved Reply with quote

Code:

cout<<"Student Name: ";
cin.getline (studName, 21);
cout<<"Student #: ";
cin.getline (studID, 10);
cout<<"Student Age: ";
cin.getline (studAge, 3);
cout<<"Student HomeForm: ";
cin.getline (studHF, 4);


When i input a name that is longer than 20 in length, then the program displays Student #, Student Age, Student HomeForm without having the user enter the inputs and the program ends.

My question is how can i fix this problem without having to change the size of the name and others.

Thanks in advance.


Last edited by zhanfeng123 on Tue Dec 23, 2008 10:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Tue Dec 23, 2008 8:14 pm    Post subject: Reply with quote

You should post your whole piece of code if you want help.
_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Tue Dec 23, 2008 9:00 pm    Post subject: Reply with quote

Code:

cin.getline( variable, length );
fflush( stdin );

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
zhanfeng123
How do I cheat?
Reputation: 0

Joined: 20 Jan 2008
Posts: 9

PostPosted: Tue Dec 23, 2008 10:03 pm    Post subject: Reply with quote

samuri25404 wrote:
Code:

cin.getline( variable, length );
fflush( stdin );


Thanks but it didn't work but I have found another method.
Back to top
View user's profile Send private message
Stonehenge
Master Cheater
Reputation: 0

Joined: 03 Oct 2008
Posts: 280
Location: Unknown Jumphole

PostPosted: Wed Dec 24, 2008 12:37 am    Post subject: Reply with quote

zhanfeng123 wrote:
samuri25404 wrote:
Code:

cin.getline( variable, length );
fflush( stdin );


Thanks but it didn't work but I have found another method.


Can you put it here so we know what worked?

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites