Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- // Declare the function prototype: -- gerjo
- void RandomXandY( int* newX, int* newY );
- int main( )
- {
- int x = 0;
- int y = 0;
- cout << "before : " << endl;
- cout << "x = " << x << endl << "y = " << y << endl;
- cout << endl << "after : " << endl;
- RandomXandY( & x, & y );
- cout << "x = " << x << endl << "y = " << y << endl;
- }
- // Implement the prototype: -- gerjo
- void RandomXandY( int* newX, int* newY )
- {
- *newX = rand( ) % 802;
- *newY = rand( ) % 602;
- }
Add Comment
Please, Sign In to add comment