Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Object pointer casted to int* , wont increment with ++

Reply
Thread Tools

Object pointer casted to int* , wont increment with ++

 
 
Ravi
Guest
Posts: n/a
 
      12-02-2008
> I think you are confused about pre-increment / post-increment.
> Consider the following analogous example:
>
> int i = 1;
> int j = (i++);
> std::cout << j; // did you expect 2?


Thanks a lot!!
 
Reply With Quote
 
 
 
 
Ravi
Guest
Posts: n/a
 
      12-02-2008
> My advice is to be careful about making assumptions about the C++
> language based on the output of such a program.
>


Advice well taken and I will keep a note of that while learning C++
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with a casted pointer Raj Pashwar C Programming 4 10-10-2011 06:29 PM
Problem on using a casted void pointer kkirtac C Programming 10 09-24-2007 09:41 AM
problem with a casted pointer praveen C Programming 15 07-22-2007 07:43 PM
Safely deleting a type-casted pointer Pat C++ 1 02-22-2007 07:33 PM
why prefix increment is faster than postfix increment? jrefactors@hotmail.com C Programming 104 10-27-2005 11:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57