1
GATE CSE 2001
MCQ (Single Correct Answer)
+2
-0.6
Consider the following three C functions:
[P1] int*g(void)
     {
       int x=10;
       return(&x);
     }
[P2] int*g(void)
      {
        int *px;
       *px = 10;
        return px;
      }
[P3] int*g(void)
     {
       int *px
       px =(int*)malloc (size of (int));
       *px = 10;
       return px;
     }
Which of the above three functions are likely to cause problems with pointers?
A
Only P3
B
Only P1 and P3
C
Only P1 and P2
D
P1, P2 and P3
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12