Call Support +91-85588-96644
TCY online

Login

Sign Up

Please enter a Username or Email ID
Please enter a password
Keep me logged in
Please enter your name
Please enter your mobile number
You can't leave Captcha Code empty
By submitting this form, you agree to the Terms & Privacy Policy.
OR

Sign Up via Facebook

Sign Up via Google

Sign Up via Twitter

Download Software
Tests given

Download TCY App

OR
App Image
Discussion

General MCA Entrance Discussion

Shared from Arrays and Pointers on Jul 22, 2019 8:32 PM

Find out the output of the following C language codes.

int* pfunc();
void main()
{
int *Rptr,a=1,b=2,c=3;
clrscr();
Rptr=pfunc();
printf("%d %d %d",a,b,c);
printf(" %d %d %d",Rptr[0],Rptr[1],Rptr[2]);
}

int* pfunc()
{
int Num[]={2,3,4};
return Num;
}

 
1 2 3
1 2 3
1 2 3
0 0 0
Error
1 2 3
Garbage Garbage Garbage

Reply


Please type your answer before submitting.
Submit

This is Sankar GCC compiler gives the segmentation fault because of pfunc() stack destroyed