Hello everyone,
I'm trying to make a mac application that asks you what your name & age is then tells you the lowest aged person you can date.
Here's my code:
Is there something I should be using instead of scanf for NSStrings?
Thank you.
I'm trying to make a mac application that asks you what your name & age is then tells you the lowest aged person you can date.
Here's my code:
Code:
int main (int argc, const char * argv[]){
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int dateAge;
NSString *name;
NSLog(@"What is your name?");
scanf("%@", &name);
NSLog(@"How old are you?");
scanf("%i", &dateAge);
NSLog(@"Ok, %@ you can date people that are %i years old or older.",name,dateAge/2+7);
[pool drain];
return 0;
}
Thank you.
Last edited by a moderator: