[#subprocess-Popen-communicate-00]
= xref:subprocess.adoc[subprocess]::xref:subprocess/Popen.adoc[Popen]::communicate
:relfileprefix: ../../
:mrdocs:

`communicate` overloads

== Synopses

Declared in `&lt;util&sol;subprocess&period;h&gt;`

Reads the child&apos;s output and error until it exits, without sending any input&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;OutBuffer, ErrBuffer&gt;
xref:subprocess/Popen/communicate-0a.adoc[communicate]();
----

[.small]#xref:subprocess/Popen/communicate-0a.adoc[_» more&period;&period;&period;_]#

Sends a string to the child, then reads its output and error until it exits&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;OutBuffer, ErrBuffer&gt;
xref:subprocess/Popen/communicate-06b.adoc[communicate](std::string const& msg);
----

[.small]#xref:subprocess/Popen/communicate-06b.adoc[_» more&period;&period;&period;_]#

Sends a byte vector to the child, then reads its output and error until it exits&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;OutBuffer, ErrBuffer&gt;
xref:subprocess/Popen/communicate-066.adoc[communicate](std::vector&lt;char&gt; const& msg);
----

[.small]#xref:subprocess/Popen/communicate-066.adoc[_» more&period;&period;&period;_]#

Sends raw bytes to the child, then reads its output and error until it exits&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;OutBuffer, ErrBuffer&gt;
xref:subprocess/Popen/communicate-01.adoc[communicate](
    char const* msg,
    size&lowbar;t length);
----

[.small]#xref:subprocess/Popen/communicate-01.adoc[_» more&period;&period;&period;_]#

== Return Value

The captured output and error buffers&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *msg*
| Text to send first&period;
| *length*
| Number of bytes to send&period;
|===


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