codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  setting variable (very basic very strange!)  kind2allpeople at 21:30 on Friday, February 03, 2006
 

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

Rouzbeh








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  perl script help needed
•  onChange issue
•  perl remote execution
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007