FORMAT


Description:

[ CCode ( cname = "G_GINT16_FORMAT" ) ]
public const string FORMAT

This is the platform dependent conversion specifier for scanning and printing values of type int16.

It is a string literal, but doesn't include the percent-sign, such that you can add precision and length modifiers between percent-sign and conversion specifier.

gint16 in;
gint32 out;
sscanf ("42", "%" G_GINT16_FORMAT, &in)
out = in * 1000;
g_print ("%" G_GINT32_FORMAT, out);

This is not necessarily the correct format for printing and scanning
`int16_t` values, even though the in-memory representation is the same.
Standard C macros like `PRId16` and `SCNd16` should be used for `int16_t`.

Example: printf, int16:

public static int main (string[] args) {
// Output: ``10``
int16 val = 10;
print ("%" + int16.FORMAT + "\n", val);
return 0;
}

valac --pkg glib-2.0 int16.FORMAT.vala