test.c
735 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
42
43
44
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "calc_gate.h"
//struct param_gate{
// int wingwall;
// int drop_step;
// double openning_height_of_gate;
// double water_depth_front_of_gate;
// double water_depth_behind_of_gate;
// double gate_width;
//};
int main()
{
void *param;
int results=0;
double temp;
param=malloc(40);
*((int*)param)=1;
*((int*)param+1)=0;
*((double*)param+1)=5.0;
*((double*)param+2)=1.2;
*((double*)param+3)=0.2;
*((double*)param+4)=1.2;
printf("For Test\r\n");
results=Calculation_of_InstantaneousFlow(&temp,param);
printf("exec:%d,ins:%f\r\n",results,temp);
//printf("ins:%f\r\n",Calculation_of_InstantaneousFlow(5,1.2,0.1,1.2,1,0));
free(param);
return 0;
}