Challenge: user input
So far, the programs you have written do some work and then output text to the console. In this challenge, you will modify your CountDown solution to ask for input from the user. In particular, you will ask the user what number the countdown should start from.
To make this happen, you need to know about two new functions: readline() and atoi() (pronounced “A to I”).
The readline function is the opposite of printf(). Rather than printing text to the screen, it gets text that user has entered.
Before you can use readline(), you must first add the library that contains it to your program.
In the project navigator, click the top-level Coolness item. In the editor area, click Build Phases and then the disclosure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access