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

How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

3399


How do you save a c++ program?

763


Is c++ high level programming language?

879


What do you mean by early binding?

779


How new/delete differs from malloc()/free?

833


Is c++ used anymore?

824


How is modularity introduced in C++?

930


What gives the current position of the put pointer?

746


Do you know the problem with overriding functions?

794


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

894


What are friend classes?

827


What would happen on forgetting [], while deallocating an array through new?

831


What is dev c++ used for?

775


Explain the uses oof nested class?

863


What is an operator in c++?

797