Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void modificar(int * a){
- *a = (*a)*(*a);
- }
- int main(){
- int entero1 = 100;
- int entero2 = 300;
- int * ptrVariable = 0;
- ptrVariable = &entero1;
- modificar(ptrVariable);
- ptrVariable = &entero2;
- modificar(ptrVariable);
- cout << entero1 << " " << entero2 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement