-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsole-output.c
64 lines (51 loc) · 1.77 KB
/
console-output.c
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <windows.h>
#include <stdio.h>
/*
* Type of function used. Тип используемой функции
* (комбинация типов параметры и возвращаемого значения)
*/
typedef void (*importFunction)(int*, double*);
int main(int argc, char **argv)
{
importFunction StatNeuroResults;
/* Loading DLL into memory. Загружаем DLL в память */
HINSTANCE hinstLib = LoadLibrary("men.dll");
if (hinstLib == NULL) {
printf("ERROR: unable to load DLL\n");
return 1;
}
/* Get a pointer to a function. Получаем указатель на функцию */
StatNeuroResults = (importFunction)GetProcAddress(hinstLib, "StatNeuroResults");
if (StatNeuroResults == NULL) {
printf("ERROR: unable to find DLL function\n");
return 1;
}
int index;
int keyin=1;
double max;
while(1)
{
StatNeuroResults(&index,&max);
printf("\n%s","Predicted category = ");
switch(index)
{
case 1: printf("%s\n","2"); break;
case 2: printf("%s\n","3"); break;
case 3: printf("%s\n","4"); break;
case 4: printf("%s\n","5"); break;
default: break;
}
printf("\n%s%.14f","Confidence level = ",max);
printf("\n\n%s\n","Press any key to make another prediction or enter 0 to quit the program.");
keyin=getch();
if(keyin==48)break;
}
/*
* Unload the DLL. Выгружаем DLL (в принципе, это будет сделано
* автоматически при выходе из программы)
*/
FreeLibrary(hinstLib);
/* Display the result. Отображаем результат */
// printf("The result was: %f\n", result);
return 0;
}