[#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 scratch buffer to the specified expected NTBS&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 scratch buffer to the specified expected buffer&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;_]#

== Return Value

0 if the buffers match&semi; non&hyphen;zero otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *expected*
| null&hyphen;terminated string to compare against the scratch buffer
| *expectedLength*
| length of the `expected` buffer in bytes
|===


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