From the course: C Standard Library
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Random number generation - C Tutorial
From the course: C Standard Library
Random number generation
- [Instructor] Random number generation is a big thing in computer science, and to be fair, generating truly random numbers is a challenge in real computers because of their deterministic nature. This means that computer-generated sequences are predictable. An example where this is important is data encryption, which often relies on random numbers to produce keys that grant access to the encrypted data. If these keys were generated by a known computer-based random number generator, someone could figure out the algorithm and perform a so-called random number generator attack. However, there are pseudo random number sequences that computers can generate based on a special number known as a random seed. This seed serves as an index for a big collection of number sequences. The sequence generated by a seed of, say, four, will always produce the same numbers. Now the security lies in producing the seed, and so a common practice is to get this number from what is regarded as a random…
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
-
-
-
-
-
Memory allocation1m 32s
-
Memory allocation example2m 29s
-
Random number generation1m 48s
-
Random number generation example2m 40s
-
String conversion2m 11s
-
String conversion example6m 29s
-
Sort and search1m 52s
-
Sort and search main4m 50s
-
Sort and search functions5m 6s
-
Challenge: Let's get random1m 38s
-
Solution: Let's get random5m 40s
-
-
-
-