This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

displaying value of a character

how can we make display the value of a variable here?
can we use ansi c command "%d"?????

Parents
  • "%d" isn't any ANSI C command. But if you are talking about printf(), sprintf(), ... then they can normally be used - but remember that your program doesn't have any stdin and stdout, so you need to adapt the code to send any text output to a suitable device. All controlled using putchar().

    Just a question: Was there any part of the Keil manuals that you found hard to understand? Or did you jump directly to this forum without even looking at the manual information? Not even a quick use of google for "c51 printf"? You felt you saved time by ignoring Google?

Reply
  • "%d" isn't any ANSI C command. But if you are talking about printf(), sprintf(), ... then they can normally be used - but remember that your program doesn't have any stdin and stdout, so you need to adapt the code to send any text output to a suitable device. All controlled using putchar().

    Just a question: Was there any part of the Keil manuals that you found hard to understand? Or did you jump directly to this forum without even looking at the manual information? Not even a quick use of google for "c51 printf"? You felt you saved time by ignoring Google?

Children