test3.c
1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <string.h>
#include "bigpoint_cclass.h"
#include "bigpoint_dyntype.h"
int
main(int argc, char * argv[])
{
char string[] = "ein weiterer test";
int integer = 42;
float floating = 4.3;
char * rstring = NULL;
long rint = 0;
double rfloat = 0.0;
struct BIGPOINT_DYNTYPE * dynstring =
new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_STRING, strlen(string) + 1, string);
struct BIGPOINT_DYNTYPE * dynint =
new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(long), (long)integer);
struct BIGPOINT_DYNTYPE * dynfloat =
new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_FLOAT, sizeof(double), (double)floating);
bigpoint_dyntype_get(dynstring, rstring);
bigpoint_dyntype_get(dynint, rint);
bigpoint_dyntype_get(dynfloat, rfloat);
printf("%s\n", rstring);
printf("%ld\n", rint);
printf("%lf\n", rfloat);
delete(dynstring);
delete(dynint);
delete(dynfloat);
return 0;
}
// vim: set et ts=4 sw=4: