#include <sstream>
#include <string>
Go to the source code of this file.
|
#define | C_STR(X) static_cast<std::ostringstream&>(std::ostringstream().flush() << X).str().c_str() |
| Convert a stream of things to a const char *.
|
|
◆ C_STR
#define C_STR |
( |
|
X | ) |
static_cast<std::ostringstream&>(std::ostringstream().flush() << X).str().c_str() |
Convert a stream of things to a const char *.
Suppose you have a function:
void func(const char * c);
Then you can write:
func(
C_STR(
"foo"<<1<<
"bar"));
#define C_STR(X)
Convert a stream of things to a const char *.
Definition C_STR.h:28
which is equivalent to: