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

If you know then define #pragma?

763


Explain 'bus error'?

670


Where can I get an ansi-compatible lint?

753


What is the difference between if else and switchstatement

1407


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1778






Sir i need notes for structure,functions,pointers in c language can you help me please

2033


What is null pointer constant?

704


What is a newline escape sequence?

753


What is the hardest programming language?

777


What is the use of function in c?

811


Why malloc is faster than calloc?

685


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1358


what is the function of pragma directive in c?

748


What is the deal on sprintf_s return value?

733


Explain argument and its types.

701