[#BloombergLP-bsls-OutputRedirector-compare-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/OutputRedirector.adoc[OutputRedirector]::compare
:relfileprefix: ../../../
:mrdocs:

`compare` overloads

== Synopses

Declared in `&lt;bsls&lowbar;outputredirector&period;h&gt;`

Compare the character buffer pointed to by the specified pointer `expected` with any output that has been loaded into the scratch buffer&period; The `expected` buffer is assumed to be a NTBS, and its length is taken to be the string length of the NTBS&period; Return 0 if the `expected` buffer has the same length and contents as the scratch buffer, and non&hyphen;zero otherwise&period; The behavior is undefined unless `enable` has previously been called successfully&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bsls/OutputRedirector/compare-0eb.adoc[compare](char const* expected) const;
----

[.small]#xref:BloombergLP/bsls/OutputRedirector/compare-0eb.adoc[_» more&period;&period;&period;_]#

Compare the character buffer pointed to by the specified pointer `expected` with any output that has been loaded into the scratch buffer&period; The length of the `expected` buffer is supplied in the specified `expectedLength`&period; Return 0 if the `expected` buffer has the same length and contents as the scratch buffer, and non&hyphen;zero otherwise&period; Note that the `expected` buffer is allowed to contain embedded nulls&period; The behavior is undefined unless `enable` has previously been called successfully&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bsls/OutputRedirector/compare-0e8.adoc[compare](
    char const* expected,
    size&lowbar;t expectedLength) const;
----

[.small]#xref:BloombergLP/bsls/OutputRedirector/compare-0e8.adoc[_» more&period;&period;&period;_]#


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