Guest User

Untitled

a guest
Jan 21st, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. // Declare the function prototype: -- gerjo
  8. void RandomXandY( int* newX, int* newY );
  9.  
  10. int main( )
  11. {
  12.     int x = 0;
  13.     int y = 0;
  14.  
  15.     cout << "before : " << endl;
  16.     cout << "x = " << x << endl << "y = " << y << endl;
  17.  
  18.     cout << endl << "after : " << endl;
  19.     RandomXandY( & x, & y );
  20.  
  21.     cout << "x = " << x << endl << "y = " << y << endl;
  22. }
  23.  
  24. // Implement the prototype: -- gerjo
  25. void RandomXandY( int* newX, int* newY )
  26. {
  27.     *newX = rand( ) % 802;
  28.     *newY = rand( ) % 602;
  29. }
Add Comment
Please, Sign In to add comment