diff options
Diffstat (limited to 'gfsm/gfsm/src/libgfsm/tests/ftest.c')
-rw-r--r-- | gfsm/gfsm/src/libgfsm/tests/ftest.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gfsm/gfsm/src/libgfsm/tests/ftest.c b/gfsm/gfsm/src/libgfsm/tests/ftest.c new file mode 100644 index 0000000..e571f31 --- /dev/null +++ b/gfsm/gfsm/src/libgfsm/tests/ftest.c @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <glib.h> + +int main (int argc, char **argv) { + float f, f2; + gpointer p; + int i; + + for (i=1; i<argc; i++) { + sscanf(argv[i], "%f", &f); + p = (gpointer)(*((int*)(&f))); + f2 = *((float*)(&p)); + printf("argv[i=%d]='%s' ; f=%g ; f->p=%p ; p->f=%g\n", i, argv[i], f, p, f2); + } + + return 0; +} |