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 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](/WebImages/33/given-the-following-int-ip-int-a10-ip-a3-int-ip2-a-assign-o-1096976-1761578718-0.webp)