[#BloombergLP-bsls-OutputRedirector-compare-0eb] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/OutputRedirector.adoc[OutputRedirector]::compare :relfileprefix: ../../../ :mrdocs: Compare the character buffer pointed to by the specified pointer `expected` with any output that has been loaded into the scratch buffer. The `expected` buffer is assumed to be a NTBS, and its length is taken to be the string length of the NTBS. Return 0 if the `expected` buffer has the same length and contents as the scratch buffer, and non‐zero otherwise. The behavior is undefined unless `enable` has previously been called successfully. == Synopsis Declared in `<bsls_outputredirector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int compare(char const* expected) const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#