curs\_addchstr(3X) Library calls curs\_addchstr(3X)

# [NAME](#NAME)

**addchstr**, **waddchstr**, **mvaddchstr**, **mvwaddchstr**, **addchnstr**, **waddchnstr**, **mvaddchnstr**, **mvwaddchnstr** - add a *curses* character string to a window

# [SYNOPSIS](#SYNOPSIS)

```
#include <curses.h>
```

```
int addchstr(const chtype * chstr);
int waddchstr(WINDOW * win, const chtype * chstr);
int mvaddchstr(int y, int x, const chtype * chstr);
int mvwaddchstr(WINDOW * win, int y, int x,


      const chtype * chstr);
```

```
int addchnstr(const chtype * chstr, int n);
int waddchnstr(WINDOW * win, const chtype * chstr, int n);
int mvaddchnstr(int y, int x, const chtype * chstr, int n);
int mvwaddchnstr(WINDOW * win, int y, int x,


      const chtype * chstr, int n);
```

# [DESCRIPTION](#DESCRIPTION)

**waddchstr** copies the string of *curses* characters *chstr* to the window *win*. A null *curses* character terminates the string. **waddchnstr** does the same, but copies at most *n* characters, or as many as possible if *n* is **-1**. [**ncurses**(3X)](/man/os/ncurses/ncurses.3X) describes the variants of these functions.

Because these functions do not call [**waddch**(3X)](/man/os/ncurses/waddch.3X) internally, they are faster than [**waddstr**(3X)](/man/os/ncurses/waddstr.3X) and [**waddnstr**(3X)](/man/os/ncurses/waddnstr.3X). On the other hand, they

- do not treat the backspace, carriage return, or line feed characters specially;
- do not represent unprintable characters with [**unctrl**(3X)](/man/os/ncurses/unctrl.3X);
- do not update the cursor position to follow the last character written; and
- truncate the string at the window's right margin, rather than wrapping it to the next line and potentially scrolling.

# [RETURN VALUE](#RETURN_VALUE)

These functions return **OK** on success and **ERR** on failure.

In *ncurses*, these functions fail if

- the *curses* screen has not been initialized,
- *chstr* is a null pointer, or
- (for functions taking a *WINDOW* pointer argument) *win* is a null pointer.

Functions prefixed with “mv” first perform cursor movement and fail if the position (*y*, *x*) is outside the window boundaries.

# [NOTES](#NOTES)

All of these functions except **waddchnstr** may be implemented as macros.

# [PORTABILITY](#PORTABILITY)

X/Open Curses Issue 4 describes these functions. It specifies no error conditions for them.

SVr4 describes a successful return value only as “an integer value other than *ERR*”.

# [HISTORY](#HISTORY)

SVr3.1 (1987) introduced these functions.

# [SEE ALSO](#SEE_ALSO)

[**curs\_add\_wchstr**(3X)](/man/os/ncurses/curs_add_wchstr.3X) describes comparable functions of the *ncurses* library in its wide-character configuration (*ncursesw*).

[**curses**(3X)](/man/os/ncurses/curses.3X), [**curs\_addch**(3X)](/man/os/ncurses/curs_addch.3X), [**curs\_addstr**(3X)](/man/os/ncurses/curs_addstr.3X)

2025-08-16 ncurses 6.6

---

Document: addchnstr(3x) from ncurses 6.6.20261031-r0 (Chainguard OS)
Source: https://github.com/ThomasDickey/ncurses-snapshots
