-
lil prob
thanks for the help sunny n sly in the last post but salem locked it so i have to make a new one for the other problem... :/
it works, but how to i get it to tell them what age they r if its not 17 ?
ive got the name part to work just not the age, its annoying.
plz let me know, thanks.
-
I bet Salem would love to take you home and use you as target practice. You have like four other threads open in this forum less than a day old. STOP POSTING NEW ONES. I explained how to handle the name else statement. Age is no different.
-
Well this posting frenzy must come from the name I suppose....
-
sorry for posting that many ill cut down heh.
but it is different as it doesnt work... ?
Code:
the scanf( "%d" , age ); is right isnt it?
if ( age == 17 ) {
printf ( "im that age too\n" ); }
else {
printf ( "you are %d\n", age ); }
this will not work it just says, you are and a double arrow char.
-
Code:
scanf ( "%d", &age );
This symbol refers to the address of the variable. In the case of name, which is an array, the array name without an index already refers to the address.
-
oh yeh i see sorry. i had the &name but i took it out because name didnt use one, didnt know arrays didnt need one. sorry.
thankyou.
-
geez it still wont work. if i type in the age part, 60 it gives
your age is 2293612
whats the problem cuz the code looks good to me.. then again im a n00b.
-
Oh that's my fault, copied the wrong line for the example. :p
The & sign goes on the scanf variable not the printf variable. :p