Start by setting up a char array, which contains the characters you want to choose from. For "all lowercase characters" that would be:
char pickFrom[] = "abcdefghijklmnopqrstuvwxyz";
Then create a random number generator using
srand
:
C library function - rand() - Tutorialspoint[
^]
You can now use
rand
inside a loop to "pick" random characters from the array (using the modulus operator) and set them into your output string.
Give it a try: it's isn't hard to do if you think about it!