Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 6
Member Avatar for Qmage

The do...while loop works fine when i key in only single character, however if i key in multiple characters, the default statement is executed infinitely. I think the problem lies in cin >> int?, i need some help in modifying the code, thx [CODE] bool rightanswer = true; do { …

Member Avatar for Qmage
0
87
Member Avatar for Qmage

for example [CODE] cout << "User Name: "; getline( cin, s.userName); cout << "Gender: "; cin >> s.gender();[/CODE] but i can't use s.userName or s.gender, because they are protected value(incapsulation), how do i use setUserName(string)/ setGender(char) together with getline/cin?

Member Avatar for Peppercat101
0
3K
Member Avatar for Qmage

This is just part of my code. For some unknown reason, the value of staff is correct after using copy constructor, however, once it goes out of the loop, 2 of s value's turn into -858993460, other values stay fine, look at the red lines part of the code [CODE] …

Member Avatar for Qmage
0
396