From the course: Secure Coding in C

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Challenge: The secret code

Challenge: The secret code - C Tutorial

From the course: Secure Coding in C

Start my 1-month free trial

Challenge: The secret code

(upbeat music) - [Instructor] Your challenge is to update a user's secret code. You're going to do so in the following steps. Prompt the user to input their current secret code. If using the fgets function which I recommend, check for null input and remove the newline. Confirm that the code is exactly five characters long. Create a new code by appending the word new to the existing code, output the updated code to the user and practice your safe coding with strings for all of these steps. This challenge should take about 15 minutes to complete.

Contents