ScanF not working

0 John Remy · February 26, 2015
Hey All,

I am doing the tutorial from Objective C (couldn't find a topic just for Objective C).
I am on the 14th video with nested For loops and tried to use the scanf function.
When I tried to enter an integer, the program wouldn't continue execution.  I then input an alpha character and it executed and then exited.   Video as well.

Has anyone ever seen issues with scanf?  Is there a setting I don't have enabled?


Post a Reply


Oldest  Newest  Rating
0 John Remy · February 26, 2015
Thank you for the feedback everyone.  Couldn't find an objective C forum.  Didn't want to post in iOS forum, thought C forum would be better since this is a superset of C

I tried to paste the code in and it kept cutting off.  The forum submission has a character limit I'm guessing.  

@linguist I don't see much of the code you input for the C or for the Objective C.  It stops before the FOR loops is declared.  See screen shot.   Can you resend/repost?

I have taken the time to go through all of bucky's tutorials on C and then moved onto the objective C tutorials.  I experienced that same issue with ScanF in the C tutorials as well, but just kept moving forward.

0 c student · February 26, 2015
hi, not sure about objective c, you might have the wrong forum here but i think the problem might be your second for loop where b<userNum.  try again with a bigger numbers, like 100?  b's corresponding integer value might be bigger than just 6 or 10 whereas y would definitely have a bigger integer value which would break the loop, explaining your strange result.
  • 1



One of the most popular languages of all time.

Bucky Roberts Administrator