1. Engineering
  2. Computer Science
  3. write in c part 1 define int variables x and...

Question: write in c part 1 define int variables x and...

Question details
write in c++ 

part 1
Define int variables x and y and int* pointer variables p and q.  

   Assign x the value 2, y the value 8, set p to contain the address of x, and q to contain the address of y.
   
   Then output the following information, using appropriate messages:
   
   a. The address of x and the value of x.
   
   b. The value of p and the value of *p.
   
   c. The address of y and the value of y.
   
   d. The value of q and the value of *q.
   
   e. The address of p (not its contents!).
   
   f. The address of q (not its contents!).

Part II

2.  For the following, use the pointer notation ONLY. Do NOT use the array index [] notation.
    Define the variables below and write code which prints the characters in a c string in a reverse order.
     char s[10] = "abcde";
     char* cptr;
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution