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


Please Help Members By Posting Answers For Below Questions

What are the effects after calling the delete this operator ?

551


What does the nocreate and noreplace flag ensure when they are used for opening a file?

671


Differentiate between the message and method in c++?

602


Define basic type of variable used for a different condition in C++?

660


What is the use of c++ programming language in real life?

558






Differentiate between a pointer and a reference with respect to c++.

695


What is the use of setfill in c++?

577


Are vectors faster than arrays?

567


Write syntax to define friend functions in C++.

599


What is an adaptor class in c++?

596


What is c++ manipulator?

549


Why is it called c++?

578


Explain the operation of overloading of an assignment operator.

687


How much do coding jobs pay?

546


Describe linkages and types of linkages?

559