基本通信协议格式打印(用来调试)
#include "stdafx.h" #include <stdio.h> #include <string.h> #include <math.h> #include<stdlib.h> #include <dos.h> #include <conio.h> typedef unsigned char u8; void print_hex(u8*buf, int length) { for (int i = 0; i < length; i++) { printf(" 0x%x",(u8)buf[i]); } printf("\n"); } static u8 buf[] = { 0xff,0xff,0xff,0xff,0x01,0x02,0x03,0x04,0x05 }; int main() { print_hex(buf,10); while (1); return 0; }

一勤天下无难事。

浙公网安备 33010602011771号