O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
to_string.c File Reference

Convert numbers to string. More...

#include "o2s/to_string.h"
#include "o2s/preprocessing.h"
#include <ctype.h>
#include <inttypes.h>
#include <iso646.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

string_t float_to_string (const float *value)
 Create a sring from a float.
string_t double_to_string (const double *value)
 Create a string from a double.
string_t int_to_string (const int *value)
 Create a string from an integer.
string_t short_to_string (const short *value)
 Create a string from a short integer.
string_t long_to_string (const long *value)
 Create a string from a long integer.
string_t unsigned_to_string (const unsigned *value)
 Create a string from an unsigned integer.
string_t cstring_to_string (const char *const *value)
 Create a string from a null-terminated character string.
string_t char_to_string (const char *c)
 Creates a string to represent the char pointed to by c.
const char * boolean_to_cstring (bool value)
 Null-temrminated string from a boolean.

Detailed Description

Convert numbers to string.

Author
Antoine GAGNIERE

Definition in file to_string.c.

Function Documentation

◆ boolean_to_cstring()

const char * boolean_to_cstring ( bool value)

Null-temrminated string from a boolean.

Returns
  • "true" if the parameter is true
  • "false" otherwise

Definition at line 167 of file to_string.c.

◆ char_to_string()

string_t char_to_string ( const char * c)

Creates a string to represent the char pointed to by c.

If c is printable, it will be included directly, else a escape sequence. In both cases surrounded by single quotes

Definition at line 126 of file to_string.c.

◆ cstring_to_string()

string_t cstring_to_string ( const char *const * value)

Create a string from a null-terminated character string.

If the parameter is the NULL pointer, the returned string is "(null)".

Definition at line 114 of file to_string.c.