Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- /********************************
- int numRandom(int min, int max);
- int * arryRandom();
- ***********************************/
- int main(void) {
- int max = 10, min = 0;
- int count = 0;
- int *p;
- p = arryRandom();
- for(count;count < max;count++){
- printf("*(p + %d) : %d\n", count, *( p + count ));
- }
- return 0;
- }
- /*********************************************/
- int numRandom(int min, int max) {
- return rand() % (max - min + 1) + min;
- }
- /*************************************************/
- int * arryRandom() {
- int i;
- int arry[10];
- srand( (unsigned)time( NULL ) );
- for (i = 0; i < 10; i++) {
- arry[i] = numRandom(0, 9);
- }
- return arry;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement