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 |
Advantage and disadvantage of routing in telecom sector
What is abstract class in oop?
Write an operator overloading program to write S3+=S2.
What is Method overloading?
What is the difference between C++ and java?
wht is ditch
How to execute business logic for only once ..?even though user clicks submit button multiple times by mistake..? (i disabled JavaScript)
what is pointers
polymorphism means?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)
What will happen when the following code is run: int x; while(x<100) { cout<<x; x++; } 1) The computer will output "0123...99" 2) The computer will output "0123...100" 3) The output is undefined