Advertisement
cardel

EjercicioPractica28Sep

Sep 28th, 2016
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void modificar(int * a){
  5.     *a = (*a)*(*a);
  6. }
  7.  
  8. int main(){
  9.     int entero1 = 100;
  10.     int entero2 = 300;
  11.    
  12.     int * ptrVariable = 0;
  13.    
  14.     ptrVariable = &entero1;
  15.     modificar(ptrVariable);
  16.    
  17.     ptrVariable = &entero2;
  18.     modificar(ptrVariable);
  19.    
  20.     cout << entero1 << " " << entero2 << endl;
  21.    
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement