# send one character to the stdio

**URL:** <https://forums.digi.com/t/send-one-character-to-the-stdio/5128>\
**Category:** NET+OS\
**Created:** [February 14, 2006, 2:17pm UTC](https://forums.digi.com/t/send-one-character-to-the-stdio/5128 "2006-02-14T14:17:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank1](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@Frank1](https://forums.digi.com/u/Frank1)\
**Post date:** [February 14, 2006, 2:17pm UTC](https://forums.digi.com/t/send-one-character-to-the-stdio/5128/1 "2006-02-14T14:17:42Z")

</div>

Hello,  
how can i send only one character without the  
or 0x0A to the stdio? By me the single bytes are write in a buffer, i think, and when i send a 0x0A then the buffer was sent to the UART.

thx,  
Frank

---

<div class="post-metadata">

**Author:** ![Cameron](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@Cameron](https://forums.digi.com/u/Cameron)\
**Post date:** [February 14, 2006, 2:55pm UTC](https://forums.digi.com/t/send-one-character-to-the-stdio/5128/2 "2006-02-14T14:55:58Z")

</div>

In C using printf() does not automatically add a newline (’  
') character, unlike Java’s println() function. Simply do not include the ’  
’ character in your output.

There are a couple of ways to do this:

1. 

char outputChar =‘A’;  
printf(“%c”, outputChar);

1. 

char outputStr[32];  
char outputChar = ‘A’;  
sprintf(outputSt, “%c”, outputChar);  
printf(“%s”, outputStr);

1. 

char outputChar = ‘A’;  
putc(outputChar, stdout);

In the case of using printf(), you may find that the single byte does not get transmitted immediately. In this case you may want to call fflush(stdout) after the printf().

Cameron
