[#bsl-basic_stringbuf-pbackfail-05]
= xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf]::pbackfail
:relfileprefix: ../../
:mrdocs:

Put back the specified `character` into the input sequence so that the next character read from the input sequence will be `character`&period; If `character` is either `traits&lowbar;type&colon;&colon;eof()` or is the same as the previously read character from the input sequence, then adjust the current input position, `gptr`, back one position&period; If `character` is neither `traits&lowbar;type&colon;&colon;eof()` nor the character previously read from the input sequence, but this string buffer was opened for writing (`ios&lowbar;base&colon;&colon;out`), then adjust the input sequence back one position and write `character` to that position&period; Return the character that was put back on success and `traits&lowbar;type&colon;&colon;eof()` if either the input position is currently at the beginning of the sequence or if the previous character in the input sequence is not `character` and this buffer was not opened for writing&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringbuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
xref:bsl/basic_stringbuf/int_type.adoc[basic&lowbar;stringbuf&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;::int&lowbar;type]
pbackfail(xref:bsl/basic_stringbuf/int_type.adoc[int&lowbar;type] character = traits&lowbar;type&colon;&colon;eof());
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
