-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_interface.cpp
43 lines (40 loc) · 939 Bytes
/
print_interface.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
38
39
40
41
42
43
#include <arpa/inet.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <limits.h>
#include <netinet/in.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <cerrno>
#include <ctime>
#include <iomanip>
// pauses caller
bool customSleep(int sec, int nsec)
{
struct timespec req, rem;
req.tv_sec = sec;
req.tv_nsec = nsec;
if (nanosleep(&req, &rem) != 0)
{
printf("\x1b[31m rem %d:%d strerror:%s \x1b[0m\n", (int)rem.tv_sec, (int)rem.tv_nsec, strerror(errno));
return false;
}
return true;
}
int main(void)
{
// unsigned int max = -1;
// printf("UINT_MAX = %u = 0x%x\n", UINT_MAX, UINT_MAX);
// printf("max = %u = 0x%x\n", max, max);
// printf("int32max = %d\n", INT_MAX);
// printf("long max = %ld\n", LONG_MAX);
// customSleep(3, 3);
int a = 1;
uint b = a;
printf("%d %u\n", a, b);
return 0;
}