addch - Linux


addch adds a single character to the current position of the cursor in the terminal window. It is typically used for character-based user interfaces and allows precise placement of individual characters on the screen.


  • ch: The ASCII character code (in decimal) to be added.


No options or flags are available with addch.


  • Display an asterisk at the top-left corner:
  • Add a newline character:
  • Print a sequence of characters:
addch(65); addch(66); addch(67) // Prints "ABC"

Common Issues

  • Character not appearing: Ensure that the cursor is positioned at the desired location before using addch.

  • Character appearing in the wrong place: Double-check that the correct character code is being used.


addch can be integrated with other curses commands for advanced terminal control. For example:

  • Use move(row, col) to position the cursor before adding characters.
  • Use printw to format and print multiple characters together.

Related Commands

  • mvwch: Move a window on the terminal.
  • waddch: Add a character to a specified window.
  • curs_set: Control the visibility and appearance of the cursor.