main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?

Answer Posted / ruchi

Turbo c will give an answer
samco system
amco system
pointer ptr is at r
by(*ptr)++ we are incrementing it by one so we get s
by ptr ++ we are incrementing the addrestion of ptr so it
will give an output amco system;
but gcc compiler will not give any answer it will print
segmentation fault

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are header files? What are their uses?

634


How do you use a 'Local Block'?

719


What is the difference between array and pointer in c?

577


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1323


What is anagram in c?

514






What are multibyte characters?

642


Explain setjmp()?

652


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

641


What's the right way to use errno?

620


Explain what is the heap?

618


What is the significance of an algorithm to C programming?

595


What is "Duff's Device"?

699


Differentiate between declaring a variable and defining a variable?

603


How can I read/write structures from/to data files?

546


What is n in c?

572