main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?
Answer Posted / dhakchin moorthy.p
first printf stmt prints Ramco Systems
the error is in line ptr++;here u r trying to increment the
address holding by the pointer,pointer var may lost the
starting address.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the advantage of using #define to declare a constant?
Define the scope of static variables.
Explain modulus operator. What are the restrictions of a modulus operator?
Why n++ execute faster than n+1 ?
What is class and object in c?
What is dangling pointer in c?
please explain every phase in the "SDLC" in the dotnet.
What is graph in c?
What is the difference between char array and char pointer?
What are the c keywords?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is struct node in c?
What would be an example of a structure analogous to structure c?
What is the use of sizeof?
Are there constructors in c?