uint8与与或监测【c/c++课程】
// uinttest.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #ifndef GENERIC #define GENERIC #endif using namespace std; typedef unsigned char uint8; //!< Unsigned 8 bit integer typedef unsigned short uint16; //!< Unsigned 16 bit integer uint8 uartbuf[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint8 UartRxBuf[2]; void Start_UartSend(uint8 *buf, uint16 len) { for (uint8 i = 0; i<len; i++) uartbuf[i] = buf[i]; } uint16 IOTest_Result = 0; //IO检测结果 uint16 IOTest_Result1 = 0; //第1次检测 uint16 IOTest_Result2=0; //第2次检测 int _tmain(int argc, _TCHAR* argv[]) { #if 1 uint8 IO_Test_CMDA[6] = { 'A', 'T', '+', 'I', 'O', 'A' }; uint8 IO_Test_CMDB[6] = { 'A', 'T', '+', 'I', 'O', 'B' }; Start_UartSend(IO_Test_CMDA, 6); //uartbuf[6] = '\0'; #endif IOTest_Result2 |= (1 << 2); IOTest_Result1 |= (1 << 2); IOTest_Result = IOTest_Result1&IOTest_Result2; std::cout << sizeof(uint8) << std::endl; std::cout << uartbuf << std::endl; std::cout << IOTest_Result1 << endl; system("PAUSE"); return 0; }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2023-06-04 tr069 cwmp协议二
2023-06-04 网络协议篇之CWMP协议(三)—— RPC方法
2023-06-04 vscode关闭全文查找
2021-06-04 freeglut-2.0.1
2021-06-04 fpga
2021-06-04 LoRa
2021-06-04 北京睿骊通电子技术有限公司