C
ANSI C\Microsoft C\GCC
njrobin
活到老学到老
展开
-
Win32 串口通讯简单示例程序
重叠I/O操作 回传接收到的数据 #include <stdio.h> #include <windows.h> #include "comtest.h" #define WRITE_BUF_SIZE 255 #define READ_BUF_SIZE 255 #define READ_TIMEOUT 5000 // milliseconds HANDLE hComm; OVERLAPPED osReader = {0}; OVERLAPPED osW原创 2021-12-01 16:07:47 · 962 阅读 · 0 评论 -
Winsock2 简单tcp client示例程序
C程序,事件接收、重叠发送 :回传接收到的数据 #undef UNICODE #include <windows.h> #include <winsock2.h> #include <ws2tcpip.h> #include <stdio.h> // link with Ws2_32.lib #pragma comment (lib, "Ws2_32.lib") #define AMOUNT_TO_READ 1024 SOCKADDR_IN Re原创 2021-12-01 14:25:30 · 2322 阅读 · 1 评论 -
C 语言中的 字符串
1字符串常量、字符数组 字符串常量是一对双撇号括起来的字符序列,例如: "helloworld"、"12345"、""(一个空字符串) 如"helloworld"在内存中是: h e l l o w o r l d \0 在C语言中,是将字符串作为字符数组来处理。了解这一点很重要。 规定:在每一个字符串的结尾加一个“字符串结束标志”,以便系统据此判断字符串是否结束。以字符'\0'作为字符串结束标志。'\0'是一个ASCI.原创 2021-11-04 15:28:55 · 5648 阅读 · 0 评论