qh_str()

Updated: April 19, 2023

Return a specified string, a fallback string if the specified string is NULL, or an empty string if the fallback string is also NULL

Synopsis:

#include <qh/string.h>
const char* qh_str(const char *str,
                   const char *fallback_str)

Arguments:

str
The string to be returned, if non-NULL.
fallback_str
The string to be returned, if non-NULL and str is NULL.

Library:

qh

Description:

The qh_str() function always returns a non-NULL string.

Returns:

A non-NULL string (str or fallback_str value, or an empty string).