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


Please Help Members By Posting Answers For Below Questions

how to print the character with maximum occurence and print that number of occurence too in a string given ?

2031


With the help of using classes, write a program to add two numbers.

617


What are integer variable, floating-point variable and character variable?

609


what is the structure pointer?

1644


what are non standard function in c

1433






Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

807


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

1906


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

664


What is 2 d array in c?

554


What is #line in c?

559


Explain how do you list files in a directory?

616


How can I determine whether a machines byte order is big-endian or little-endian?

617


Are the variables argc and argv are local to main?

787


What is function pointer c?

586


what are # pragma staments?

1624