CS3240: Data Structures and Algorithms

Question: Pointers ...

1. What will be the result of the following code, show values of variables and where pointers point to at the end of the code.

 char  ch;
 ch =  ‘A’;

 char*  q;
 q  = &ch; 

 *q = ‘Z’;
 char*  p;
 p = q;  

 

© Lynne Grewe