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
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is I ++ in c programming?
What are multidimensional arrays?
What are the types of operators in c?
How can I write functions that take a variable number of arguments?
What is function pointer c?
When c language was developed?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
Explain the binary height balanced tree?
How does pointer work in c?
What is the right type to use for boolean values in c?
What is the difference between int main and void main?
In C programming, what command or code can be used to determine if a number of odd or even?
Why we use break in c?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?