void main(void) { char ebit,ans; ebit = 0x01; ans = ebit*(100/256); } how can i display the value in ans on LCD ? void lcdPutStr (char *string) { char i; i=0; while(string[i]) { lcdPutCh (string[i++]); } } this is the program segment for putting the characters into LCD
"You also may have..." To find out exactly what you do have, look in the C1 Manual!!
It's "sprintf", short for "string printf". It works just like printf(), except that the very first parameter is a string to which the results are output: char buf[80]; sprintf (buf, "%d\n", myInt); You also may have an "snprintf()" to keep you from overrunning your output buffer. http://www.dinkumware.com/manuals/reader.aspx?b=c/&h=stdio.html#sprintf Some online C references: http://www-ccs.ucsd.edu/c/ http://www.dinkumware.com/libraries_ref.html Source code for string functions you don't have: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/string/
You need to get a new 'C' book, then! Look in the C51 Manual
in the c book there is scanf(); and prinf(); i dont seem to find it, is there a term for this topic regarding sprinf(); so that i can search do some research? thanks!
Look up sprintf() in your 'C' book. Stefan
View all questions in Keil forum