Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


If you had the following code: int x = 23; int *y; y = &x;
The instruction y++; does what?

Answers were Sorted based on User's Feedback



If you had the following code: int x = 23; int *y; y = &x; The instruction y++; does what?..

Answer / 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

If you had the following code: int x = 23; int *y; y = &x; The instruction y++; does what?..

Answer / anu

Then y will point to next memory location.
If we are using (*y)++ will increment value to 24.

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More C++ General Interview Questions

structure contains int, char, float how it behaves for big endian and little endian?

1 Answers   BITS,


How is static data member similar to a global variable?

0 Answers  


Explain about templates of C++.

0 Answers  


What is the difference between an enumeration and a set of pre-processor # defines?

0 Answers  


What is implicit conversion/coercion in c++?

1 Answers  


sizeof - is it a function or operator?

6 Answers   Honeywell,


Why c++ is better than c language?

0 Answers  


Which is best ide for c++?

0 Answers  


How much is size of struct having 1 char & 1 integer?

11 Answers   Persistent,


Is there a datatype string in c++?How is the memory allocation?

3 Answers  


What is a breakpoint?

0 Answers  


What do you mean by ‘void’ return type?

0 Answers  


Categories