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
What is meant by gets in c?
What is structure padding and packing in c?
What is page thrashing?
What is the role of && operator in a program code?
What is register variable in c language?
Differentiate between null and void pointers.
What is static and auto variables in c?
What is use of pointer?
What type of function is main ()?
What is the g value paradox?
Why do we write return 0 in c?
If errno contains a nonzero number, is there an error?
What is a void pointer in c?
What is the use of gets and puts?
What is the difference between the expression “++a” and “a++”?