Author |
Message |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 6:31 pm Subject: (f)printf format %u %d broken ? |
my solution ...
not so beautifull but 10 minutes long...
void printSigned(signed int d)
{
if (d<0) { putc('-'); d=d*(-1);}
else { putc(' '); }
putc(d/10000+'0');
d=d%10000;
putc(d/ ... |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 5:58 pm Subject: (f)printf format %u %d broken ? |
I forgot...
thanks and regards for now
I'll write you if can found a solution... |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 5:56 pm Subject: (f)printf format %u %d broken ? |
no It doesn't work fot me...
#use rs232(baud=38400,UART2,ERRORS,STREAM=seriale)
char stringa[30];
x=(unsigned int16)60000;
y=(signed int16)-1000;
fprintf(stringa,"%u %d",x,y); //* ... |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 7:28 am Subject: (f)printf format %u %d broken ? |
unfortunally my PCD account start with 4.066 version (and it doesn't work)
and it's not possible download old version....
regards
Daniele |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 4:28 am Subject: (f)printf format %u %d broken ? |
look this
...
x=(unsigned int16)60000;
printf("%Lu ",x);
y=(signed int16)-1000;
printf("%Ld ",y);
... this print "60000 64536 "
...
y=(signed int16)-1000;
pr ... |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sun Feb 10, 2008 4:21 am Subject: (f)printf format %u %d broken ? |
Hi,
how I can use printf to write in a string?
if the bug is in printf how using this function in other way skip it?
regards. |
Topic: (f)printf format %u %d broken ? |
Daniele
Replies: 13
Views: 34020
|
Forum: General CCS C Discussion Posted: Sat Feb 09, 2008 10:01 am Subject: (f)printf format %u %d broken ? |
Compiler PCD 4.068
#include <...30F6014.h>
#fuses XT_PLL16
#use delay(clock=120000000,restart_wdt)
#use rs232(baud=38400,UART2,ERRORS,STREAM=seriale)
void main()
{
unsigned int16 x;
... |
|