If you had the following code: int x = 23; int *y; y = &x;
The instruction y++; does what?
Answer Posted / naresh kumar
here Y is integer pointer which is storing address of x.
suppose we assume address of X is 65524. this value will stored in pointer variable Y. int variable is capable of storing 2 bytes of memory. If increment or decrement variable Y, It points to next memory location, i.e 65526.
that means y=65524
y++
65526
y++
65528
this will keep on increasing by 2 bytes.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is a Default constructor?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
Explain about vectors in c ++?
What do you mean by early binding?
How to declare a function pointer?
Explain what happens when a pointer is deleted twice?
How many types of classes are there in c++?
What is double in c++?
Is c++ primer good for beginners?
Does c++ have foreach?
Is string an object in c++?
Explain one-definition rule (odr).
What is the default width for ouputting a long integer using the insertion operator?
What is lambda in c++?
What are the two shift operators and what are their functions?