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_num() {
- int* p_numero = (int*)malloc(sizeof(int));
- srand(time(NULL));
- *p_numero = rand() % 10 + 1;
- return (Item)p_numero;
- }
- int main(void) {
- printf("Num: %d", *((int *)random_num()));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement