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 |
What is difference between multiple inheritance and multilevel inheritance?
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?
Explain polymorphism? What r the types of polymorphism? pls give examples?
What is a mixin class?
What is a friend function & its advantage?
Are polymorphisms mutations?
how does a main() in C++ is different from main() in C?
Program to check whether a word starts with a capital letter or not.
Why is oop better than procedural?
if u write a class do u write Assignment operator and copy constructor
what is Class in oops with example?
What does and I oop and sksksk mean?