[Bf-committers] Blender.Image Question
Robert Wenzlaff (AB8TD)
rwenzlaff at soylent-green.com
Sun Feb 20 02:12:08 CET 2005
On Saturday 19 February 2005 16:16, Alexander Ewering wrote:
> From the manpage of printf() you've probably read:
>
> %p The void * pointer argument is printed in hexadecimal (as
> if by %#x or %#lx).
>
> To print the content of memory locations, you need to dereference the
> pointer.
Not to mention the fact that you are telling it to format the data as a
pointer and then give it no data. So it fills the format with garbage.
The part in the " "s are format codes, it should be followed by a list of data
items to fill into the format codes. IE;
int k=3;
printf("My int k = %i", k);
will print "My int k = 3". %i is int, %f is float, %x is hex, %p is pointer
(and %% is a "%" sign). If you give it a float, and tell it to format it as
an int, you'll get a different kind of garbage. C doesn't type check.
That's the C programmer's job. What do you get for this pendantic behaviour?
A minimum number of machine instructions per line of code.
Not to be rude (that's inttr's job) but this stuff is day 2 of a C programming
class.
--
**********************************************
Robert Wenzlaff rwenzlaff at soylent-green.com
More information about the Bf-committers
mailing list