+ 2
Plz... Somebody explain me this...
What is the output of this code? #include <stdio.h> int main() { static int a[]={ 10,20,30,40,50 }; static int *p[] = {a, a+3, a+4, a+1, a+2}; int **ptr = p; ptr++; printf("%d%d", ptr - p, **ptr); }
2 Respostas
+ 6
**ptr has p or a
**ptr++ has p+1 i.e.1 indexed element of p i.e. a+3 i.e. 3 index element of a i.e. 40
**ptr-p is actually p++ - p i.e. 1
So output: 1 40
+ 1
preeti dudi got it 🙂👍🏻👍🏻