absl::StatusMessageAsCStr

Retrieves a message's status as a null terminated C string.

Synopsis

Declared in <absl/status/status.h>

char const*
StatusMessageAsCStr(Status const& status);

Description

The lifetime of this string is tied to the lifetime of the status object itself.

If the status's message is empty, the empty string is returned.

StatusMessageAsCStr exists for C support. Use status.message() in C++.

Return Value

A null-terminated C string for the status message.

Parameters

NameDescription
statusThe status whose message is retrieved.