Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Suspicious pointer conversion (http://www.chiefdelphi.com/forums/showthread.php?t=62526)

ebowla 26-01-2008 11:27

Suspicious pointer conversion
 
Ive tried looking the answer up in several places and I can't seem to solve it.

Code:

unsigned int analog=(unsigned int)Get_Analog_Value(rc_ana_in01);
printf(analog);

I get an error pointing to the printf statement saying suspicious pointer conversion. The analog imput is a potentiometer. As far as I know everything is wired correctly, the code even compiles and runs, but the printf isnt displaying.

PROBLEM SOLVED CLOSE THREAD/NO MORE POSTS

JonathanLKS 26-01-2008 11:43

Re: Suspicious pointer conversion
 
printf doesn't work that way
You need to have a string, even if your just printing a single int
so you'll need to write it like this
Code:

printf("%d\r\n", analog); //\r\n for newline

ebowla 26-01-2008 12:13

Re: Suspicious pointer conversion
 
thanks, yea I figured it out on my own with the help of a mentor(who JUST showed up) I apprieciate the help.

PROBLEM SOLVED, CLOSE THREAD/NO MORE POSTS


All times are GMT -5. The time now is 13:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi