From the course: Secure Coding in C
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: The secret code - C Tutorial
From the course: Secure Coding in C
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Allocating strings2m 40s
-
(Locked)
Avoiding bad string assignment1m 28s
-
(Locked)
Working with string literals2m
-
(Locked)
Minding string functions3m 47s
-
(Locked)
Storing passwords and codes1m 15s
-
(Locked)
Clearing data after use1m 13s
-
(Locked)
Challenge: The secret code40s
-
(Locked)
Solution: The secret code1m 43s
-
(Locked)
-
-