Problems Printing Integers
Re:Problems Printing Integers
it's a self-made printf function and I didn't write the routine for %d, but I tried to write a routine for the %i argument. I doesn't work, so I asked for help.
Re:Problems Printing Integers
I have a working printf with ints, hex...and all the other stuff.
Tell me if that works....
It is in pk0.7.1
Tell me if that works....
It is in pk0.7.1
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Problems Printing Integers
that doesn't astonish me as you have some "if (i==0) break;" ... probably mainly because of the recursive behaviour of the functionThis works! But now here's the problem. If I want to print the integer value zero ("0") it prints nothing (NULL?).
i think this is because "ch" is declared as a char rather than as an unsigned char and then casted to a unsigned ... this might give weird results from the " ch % 10" function ... (i mean negative values) that would be badly interpreted ...And integer values higher than 127 are printed in characters. For example, 128 prints "/.(" (without the quotes)
btw, why do you restrict %i to chars ? why not dealing with full-sized integers ?
Re:Problems Printing Integers
Well...My old printf was not all that wonderful...it worked....but did extra things that it didn't have to ( it checked the type of \'s...but putch does that...I forgot to remove it in the release. )
I think you should use the pk0.7.1 printf.
I think you should use the pk0.7.1 printf.
Re:Problems Printing Integers
OK, but where did you post it? Your page's index.html is not online.