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 


so this is my problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
paupav
Master Cheater
Reputation: 13

Joined: 15 Apr 2011
Posts: 314
Location: P. Sherman 42, Wallaby Way, Sydney

PostPosted: Wed Aug 08, 2012 10:38 am    Post subject: so this is my problem Reply with quote

i want to make program in c++ that show exacly how old are you (how much years, months, days you have)... and im stuck, i dont know how can i do this. so on west mostly goes month,day,year and on east it goes day,month,year. so i first wanted to put string to person answer with yes or no e.g i put

Code:

cout << "Are you from West?";
getline(cin, countryString);



and then

Code:

if(countryString == no)
{
cout << "Enter day of birth! (only number) ";
getline(cin, myString);
stringstream(myString) >> day;
cout << "\nEnter month of birth! (only number)";
getline(cin, myString);
stringstream(myString) >> month;
cout << "\nEnter year of birth! (only number)";
getline(cin, myString);
stringstream(myString) >> year;
//cout << "\nYou have been born " << day;  //verification if everything is fine
}


and if yes to it goes only in other order,
P.S this is only training...


Last edited by paupav on Wed Aug 08, 2012 10:41 am; edited 1 time in total
Back to top
View user's profile Send private message
Cryoma
Member of the Year
Reputation: 198

Joined: 14 Jan 2009
Posts: 1819

PostPosted: Wed Aug 08, 2012 10:40 am    Post subject: Reply with quote

get well soon
Back to top
View user's profile Send private message
paupav
Master Cheater
Reputation: 13

Joined: 15 Apr 2011
Posts: 314
Location: P. Sherman 42, Wallaby Way, Sydney

PostPosted: Wed Aug 08, 2012 11:16 am    Post subject: Reply with quote

nvm i got it only have to write inside " "
Back to top
View user's profile Send private message
shitposter
Newbie cheater
Reputation: 5

Joined: 12 Nov 2008
Posts: 15

PostPosted: Wed Aug 08, 2012 2:22 pm    Post subject: Reply with quote

What the FUCK are you doing
Back to top
View user's profile Send private message
paupav
Master Cheater
Reputation: 13

Joined: 15 Apr 2011
Posts: 314
Location: P. Sherman 42, Wallaby Way, Sydney

PostPosted: Thu Aug 09, 2012 10:18 am    Post subject: Reply with quote

what is wrong here

Code:

diffDays=todaysDay-dayOfBirth;
diffMonths=todayMonth-monthOfBirth;
diffYears=todayYear-yearOfBirth;

if(diffDays >> 0)
{
   diffDays + 30;
   diffMonths - 1;

}

if(diffMonths >> 0)
{
   diffMonths + 12;
   diffYears--;
}

if(diffYears << 0)
cout << "\nWrong input!\nPlease enter real year of birth";


where is diffYears - difference between today day and day of birth
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam 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