refine vg_msg slightly
[vg.git] / projects / encode.c
1 #include "../vg_platform.h"
2
3
4 struct yo
5 {
6 float a, b, c, d;
7 };
8
9 int main( int argc, const char *argv[] )
10 {
11 struct yo yo = { 300.324, 2023.334, -324.1232, 30.494 };
12 printf( "{%f %f %f %f}\n", yo.a, yo.b, yo.c, yo.d );
13
14 char text[ sizeof(yo)*2 ];
15 vg_bin_str( &yo, text, sizeof(yo) );
16
17 printf( "encoded: %.*s\n", (int)(sizeof(yo)*2), text );
18
19 vg_str_bin( text, &yo, sizeof(yo)*2 );
20
21 printf( "{%f %f %f %f}\n", yo.a, yo.b, yo.c, yo.d );
22 }