Assume that the we are using 32 bit machine and size of int is 4. #include…

Assume that the we are using 32 bit machine and size of int is 4.

#include <stdio.h>
void fun(char**);
int main()
{
char *arr[] = { "ab", "cd", "ef", "gh", "ij", "kl" };
f(arr);
return 0;
}
void fun(char **p)
{
char *t;
t = (p += sizeof(int))[-1];
printf("%s\n", t);
}

By what we can replace the underlined line so that program will give same results in both cases?

  1. A.

    t = *p - 2

  2. B.

    t = *(p - 1)

  3. C.

    t = *p + 2

  4. D.

    t = *(p +3)

Attempted by 270 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…