CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

printf int32 variable

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JJJ
Guest







printf int32 variable
PostPosted: Tue Oct 27, 2009 8:11 am     Reply with quote

How is the best way to printf a int32 variable number above 65535 . If I use ex: printf ( “%lu”, x) when its reach 65535, the x restart from zero.

Tks, jjj
Ttelmah
Guest







PostPosted: Tue Oct 27, 2009 8:35 am     Reply with quote

It should work.
It sounds as if something somewhere perhaps in your arithmetic generating the value, is actually an int16, not an int32.
Code:

    int32 test_val=65000;
    do {
        printf( “/n/r%lu”, test_val)
        test_val+=1000;
    } while (test_val<70000);

Happily prints:

65000
66000
67000
68000
69000

for me.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group