void change_it(int []);
int main()
{
int a[5], *p;
p = a;
printf("p has the value %p\n", p);
change_it(a);
p = a;
printf("p has the value %p\n", p);
return 0;
}
void change_it(int a[])
{
int i = 777, *q = &i;
a = q; /* a is assigned a different value */
}
printf("%s%d%s\n%s%d%s\n",
"a[?] = ", *p, "?",
"a[?+1] = ", *p + 1, "?");
return 0;
}
void split_time(long int total_sec, int *hr, int *min, int *sec);total_sec is a time measured in number of seconds since midnight. hr, min, and sec are pointers to variables into which the function will store the equivalent time in hours (0-23), minutes(0-59), and seconds (0-59), respectively.
void FindTwoLargest(int a[], int n, int *largest, int *secondLargest);
When passed an array a of length n, the function will search for its largest and second-largest elements, storing them in the variables pointed to by largest and secondLargest, respectively. Use pointer arithmetic, and not array subscripting. In other words do not use counter variables or the [] operator to traverse the array.