Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

1. Can you combine the 2 statements into one ?

char *x;
x = malloc(10);

2. Is *ptr++ and ++*ptr the same ?

3. What is the output of below and why ?


main()
{
int a[] = {1,2,5,6,7};
printf("%d %d %d\n", sizeof(a), sizeof(*a), sizeof(a[0]));
}

4.
What are 2 places you can use pointers ?

5.
main()
{
int *j;
void fun(int **);
fun(&j);
}

void fun(int **k)


{
int a =10;
/* Write your code here */
}

You might also like