Mail Archives: djgpp/1999/04/03/05:20:32
In article <63gN2.58$ix1 DOT 35635 AT newse3 DOT tampabay DOT rr DOT com>, jayjohnson AT rocketmail DOT com (Jay Johnson) wrote:
>
>The program compiles and runs but it does not produce the
>expected results.
>
>I expected to get a value of 6 from the getpixel call.
>Where have I gone wrong?
>
..
here!
>float temp;
>putpixel(buffer, 0, 0, 6); /*put a pixel on 0,0 and color it 6(white)*/
>temp=getpixel(buffer, 0, 0); /*read the 0,0 pixel and store in temp*/
>sprintf(textbuf, "getpixel:%d", temp); /*put the temp value into a string*/
You used a float where an int should have been used. Compile with warnings
enabled (-Wall), and gcc will give you a warning when try to pass the float,
while using a "%d" format.
--
----------------------------------------------------------------------
Manni Heumann
Bielefeld, Germany
----------------------------------------------------------------------
- Raw text -