company logo

String :: toCString - Convert string to C-string

C-strings are strings that could be defined as string constant in a C program. C-strings must not contain several characters, wich are converted as follows:

  • \ ==> \\
  • newline (10) ==> \n
  • carriage return (13) ==> \r
    • backspace (8) ==> \b
    • form feed (12) ==> \f
    • tab (9) == \t
  • " ==> \"

Conversion is done inplace. In order to normalize the string later on, fromCString() may be called.

Return value:  String value ( odaba::String & )

Implementation details

odaba::String String  :: toCString (  )