char* ptr = "Rahul";
*ptr++;
printf("%s",ptr);
What will be the output
Answers were Sorted based on User's Feedback
Answer / vadivelt
Since address pointed by ptr got incremented, ptr will point to
address of char 'a'.
So o/p will be - ahul
| Is This Answer Correct ? | 73 Yes | 5 No |
Answer / amit
Ans: ahul
Reason:
Initially character pointer ptr pointed to the first character
of Rahul..when we increase it by increament operator it increase one byte.because size of character is one bye..
now it point to a..
we print from here
therefore we got above answer
so
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sayali
this code generates the output as,
ahul
but is also generate warning
that
code has no effect..
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / deepak
Ans:Sahul
Reason:
Intially *ptr contains ASCII value of 'R' on incrementing it
will points to ASCII value of 'S'.
| Is This Answer Correct ? | 2 Yes | 15 No |
Why is static class not inherited?
What is difference between #define and const?
Write a program to get the binary tree.
Write a program to find out the number of palindromes in a sentence.
Why u change company?
Can we call a base class method without creating instance?
i^=j; j^=i; i^=j; value of i,j
Child cObj = new Parent() Wahts the output ?
pointers are support in C#? if yes then how to use it?
8 Answers Softvision Solution,
when to use 'mutable' keyword and when to use 'const cast' in c++
What is the types of inheritance?
what does exactly the linker do?