2017-09-10 5 views

Répondre

2
void func(unsigned *u) 
{ 
    *u >>= 1;  // do the operation on the unsigned value pointed by u. 
        // u contains the address of the object (in this case, the unsigned) 
} 

et appelez

unsigned a = 23; 
func(&a); // pass the pointer to the variable a. After the function executes, 
      // a will be changed as the operation is done on it.