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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "usred.c"

struct usred test;


int main() {
    int i;
    double tmp=0, tsr=2;
    init_usred(&test, 10, 2);
    while(1) {
	printf("Enter [%u]:",test.data_index);<--- %u in format string (no. 1) requires 'unsigned int' but the argument type is 'unsigned long'.
	scanf("%lf", &tmp);
	tsr = tmp;
	if(tmp == 219.0)
	    break;
	if(tmp == 322.0) {
	    //printf("reinit test");
	    free_usred(&test);
	    //while (1) 
	    //init_usred(&test, 10, 2);
	}
	write_usred(&test, 2, &tmp, &tsr);
	printf("Usred data tmp:%f data_redy:%d data_index: %u\n", tmp, test.data_redy, test.data_index);<--- %u in format string (no. 3) requires 'unsigned int' but the argument type is 'unsigned long'.
	
    }
    free_usred(&test);
    return 0;
}