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 |
Out of 4 concepts, which 3 C++ Follow?
What is variable example?
what type of question are asked in thoughtworks pair programming round ?
What is Method overloading?
Which is the only operator in C++ which can be overloaded but NOT inherited?
Can we call a base class method without creating instance?
143.what is oops principles?
Which is better struts or spring?
What is encapsulation in ict?
Write a C++ program to conduct an election of a mayor.Declare a class ELECTION With the following specification: Data member: Name 25 character Age Integer symbol 1 character Member functions: To accept data for 20 contestant To accept symbol as voting from 100 voters. To declare the winner and the loser.
1 Answers Global Academy, Infotech,
what is main difference between object oriented object base
Get me an image implementation program.