Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- typedef void *Item;
- Item random_char() {
- char *p_char = (char *)malloc(sizeof(char));
- srand(time(NULL));
- *p_char = (rand() % ('a' - 'z' + 1)) + 'a';
- return (Item)p_char;
- }
- int main(void) {
- printf("Char: %c", *((char *)random_char()));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement