main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?
Answer Posted / chappa
The first increment is incorrect, since it will try to
increment the value of 'R' but will end up giving
Segmentation fault.
Second ptr++ is valid as it will shift the pointer from 'R'
to 'a'. The second print statement would have printed "amco
Systems", the compiler gives Seg fault due to the previous
incorrect increment.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why cant I open a file by its explicit path?
I need testPalindrome and removeSpace
#include
What is c system32 taskhostw exe?
How can you determine the size of an allocated portion of memory?
write a program fibonacci series and palindrome program in c
What is the general form of #line preprocessor?
write a progrmm in c language take user interface generate table using for loop?
What is a stream water?
What is scope rule in c?
What are different types of variables in c?
What is the use of bitwise operator?
what value is returned to operating system after program execution?
What is uint8 in c?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is the -> in c?