forked from giraffe-tree/jna-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.cpp
41 lines (29 loc) · 737 Bytes
/
hello.cpp
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
#include "hello.h"
void getBool(bool x) {
// 255
printf("bool: %d", x);
if (x) {
printf(" in true\n");
}else {
printf(" in false\n");
}
}
int max(int num1, int num2) {
return num1 > num2 ? num1 : num2;
}
void testArray(uint16_t* vals, int len) {
for (int j = 0; j < len; j++) {
printf("vals[%d]: %d \n", j, vals[j]);
}
}
void testStruct(ArrInfo arrInfo) {
for (int j = 0; j < arrInfo.len; j++) {
printf("arrInfo[%d]: %d \n", j, arrInfo.vals[j]);
}
}
void printUser(User user) {
printf("printUser user: %s height: %d weight: %.2f \n", user.name, user.height, user.weight);
}
void printUserRef(User& user) {
printf("printUserRef user: %s height: %d weight: %.2f \n", user.name, user.height, user.weight);
}