variable setting (very basic very strange)
Hi all ;
I have two lines of code as the following :
last_recived = (mh->seq)+1 ;
fprintf(stderr,"me %d ,mh->seq= %d \n ",last_recived,(mh->seq)+1 ) ;
both variables (last_recived and (mh->seq)+1) are Int . when this is being printed the values of last_recived and the (mh->seq)+1 are different!!! I am sure that this is the only where in my program that some thing is being printed out ! how is that possible? These two lines are exactly after each other! I am thinking about some sort of compiler bug or so . if I put
last_recived = 1 ;
before printing then 1 is being printed for last_recived ; more surprisingly if I put
last_recived ++ ;
before printing some values like 2789 are being printed which is almost 500 less that the (mh->seq)+1
and finally if some where in my program (before these two lines) I put last_recived++ ; the the printed value for last_recived will be one less than (mh->seq)+1 !!!!!!!
I am using an old machine with Red hat Linux installed on that. I’m sure both variables are int. is there any possibility for computer resources shortage such as memory or ...?
Many thank & Regards