```{index} single: cstring (XString) ``` ```{index} single: XString::cstring ``` # cstring Quote a string as a C string literal. ## Synopsis ```perl my $c = XString::cstring($str); ``` ## What you get back `$str` between double quotes, with `"` and `\` escaped, `\n`, `\r`, `\t`, `\a`, `\b`, `\f` and `\v` in their C spelling, `??` written so that it cannot form a trigraph, and every other unprintable byte as a three-digit octal escape. `undef` gives `0`, unquoted. The same as `B::cstring`.