Answer to Question #88756 in C++ for Shivam

Question #88756
How is pointer different from ordinary variable? What is the output of the following program segment ?

#include <in stream. h>
void main ( )
{

char *st="Beautiful "
st++;
cout <<st <<endl;
st+=2
cout <<st <<endl;
}
1
Expert's answer
2019-04-29T13:39:30-0400

The difference between a variable and a pointer is that the variable stores the value, and the pointer stores the address of another variable.

Output of this program:

eautiful

utiful


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS