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 objects and function
Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.
What is polymorphism in oops with example?
What is class in oop with example?
what is a virtual class?
5 Answers Cap Gemini, IBM, Infosys, Trinity Technologies,
What do you mean by public, private, protected and friendly?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
Why is polymorphism needed?
What does it mean when someone says I oop?
Can we create object of abstract class?
why we call c++ is object oriented lanaguage
Which method cannot be overridden?