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 the role of copy constructor in copying of thrown objects?
What is a modifier in c++?
Explain the uses oof nested class?
What is a hashmap c++?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What are maps in c++?
What is c++ namespace?
Write about the use of the virtual destructor?
What are files in c++?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What is the use of namespace std in C++?
How can you quickly find the number of elements stored in a dynamic array?
what do you mean by volatile variable?
How new/delete differs from malloc()/free?
If all is successful, what should main return a) 0 b) 1 c) void