Answers

Question and Answer:

  Home  Linux Device Drivers

⟩ What is the output of this program? #include<stdio.h> #inlcude<stdlib.h> int main() { int *ptr; double *ptr; printf("%dn",sizeof(ptr)); return 0; } a) 4 b) 8 c) the compiler will give the error d) segmentaion fault

c) the compiler will give the error

Explanation:

Just see the output carefully.

Output:

[root@localhost google]# gcc -o san san.c

san.c: In function 'main':

san.c:8:10: error: conflicting types for 'ptr'

san.c:7:7: note: previous declaration of 'ptr' was here

[root@localhost google]#

 181 views

More Questions for you: