Given the following int ip int a10 ip a3 int ip2 a Assign o

Given the following: int *ip; int a[10]; ip = &a;(3); int *ip2; a) Assign one location after the first pointer (ip) to the second pointer (ip2) using pointer notation b) If ip still points to a[3], then set a[6] to 7 and a[1] to 4 using pointer notation.

Solution

a) Assign one location after the first pointer (ip) to the second pointer (ip2) using pointer notation.

ip2 = ip + 1;

b) If ip still points to a[3], then set a[6] to 7 and a[1] to 4 using pointer notation.

if(ip == &a[3])

{

*(a +6) = 7;

*(a +1) = 4;

}

 Given the following: int *ip; int a[10]; ip = &a;(3); int *ip2; a) Assign one location after the first pointer (ip) to the second pointer (ip2) using point

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site