Advertisement
Guest User

puntatori

a guest
Apr 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. #include <stdio.h> /* printf, NULL */
  5. #include <stdlib.h> /* srand, rand */
  6. #include <time.h> /* time */
  7. #include <iostream>
  8. #include <string>
  9. #include <stdio.h> /* printf, NULL */
  10. #include <stdlib.h> /* srand, rand */
  11. #include <time.h>
  12.  
  13.  
  14. int * popola_array()
  15. {
  16. srand(time(NULL));
  17. static int alberto[10];
  18.  
  19.  
  20. for(int i=0;i<10;i++){
  21. alberto[i]=rand();
  22. std::cout<< i << ": "<<alberto[i]<<"!\n";
  23. }
  24.  
  25. return alberto;
  26. }
  27.  
  28.  
  29.  
  30. int main()
  31. {
  32. int * giacomo;
  33. giacomo = popola_array();
  34.  
  35. std::cout<< ": "<< *giacomo <<"!\n";
  36.  
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement