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
Which operations are permitted on pointers?
what are the types of Member Functions?
What do you mean by enumerated data type?
How a new operator differs from the operator new?
What is recursion?
What is iomanip c++?
Mention the ways in which parameterized can be invoked. Give an example of each.
Does improper inheritance have a potential to wreck a project?
What's the hardest coding language?
Describe the role of the c++ in the tradeoff of safety vs. Usability?
State the difference between pre and post increment/decrement operations.
Out of fgets() and gets() which function is safe to use?
What is an orthogonal base class in c++?
Array base access faster or pointer base access is faster?
What are static variables?