会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
管理
订阅
2021年12月22日
一维函数指针数组和二维函数指针数组demo
摘要: #include<stdio.h> static int add(int a,int b); static int sub(int a,int b); static int mul(int a,int b); static int div(int a,int b); static int abs(i
阅读全文
posted @ 2021-12-22 15:07 hiligei
阅读(55)
评论(0)
推荐(0)
2021年10月19日
esp32 python上位机(命令行)
摘要: import os import sys import tty import termios import serial import serial.tools.list_ports class ser_conf: def port_choose(self): port_list = list(se
阅读全文
posted @ 2021-10-19 17:23 hiligei
阅读(561)
评论(0)
推荐(0)
2021年10月17日
ESP32扫描环境中的所有WiFi并且通过串口选择需要连接的WiFi
摘要: #include <stdio.h> #include "freertos/FreeRTOS.h" #include "freertos/event_groups.h" #include "esp_wifi.h" #include "esp_log.h" #include "esp_event.h"
阅读全文
posted @ 2021-10-17 17:22 hiligei
阅读(1215)
评论(0)
推荐(0)
2020年4月19日
汇编字符串末尾以00H或 0AH和00H结尾
摘要: 例如:db 'hello',0 用 C 语言百定义字符串时,编译软件会自动在字符串的末尾,加上一个零('\0')。作为度字符串结束的标记。 用汇编的 DB 伪指令定义字符串,编译软件没有自动加上零的功能。如果编程者想要加上零,就必须在程序中,自己加上零。 Hello db 'hello',0dh,0
阅读全文
posted @ 2020-04-19 20:32 hiligei
阅读(1930)
评论(0)
推荐(0)
2020年4月18日
汇编栈帧
摘要: 本文转载于https://www.jianshu.com/p/b666213cdd8a 一:esp寄存器和ebp寄存器 (1)ESP:栈指针寄存器(extended stack pointer),其内存放着一个指针,该指针永远指向系统栈最上面一个栈帧的栈顶。esp 寄存器又被称为栈指针(Stack
阅读全文
posted @ 2020-04-18 11:35 hiligei
阅读(582)
评论(0)
推荐(0)
2020年3月19日
lw_oopc(c语言实现面向过程宏文件)解析
摘要: 一:计算结构体成员变量偏移量宏 #ifdef LW_OOPC_USE_USER_DEFINED_OFFSETOF // 有些环境可能不支持,不过,这种情形极少出现 #define LW_OOPC_OFFSETOF(s,m) (size_t)&(((s*)0)->m) #endif 二:INTERFA
阅读全文
posted @ 2020-03-19 21:32 hiligei
阅读(1235)
评论(0)
推荐(1)
2020年3月18日
C语言实现类
摘要: #ifndef __DEFINE__H__ #define __DEFINE__H__ #define vector3(type) \ typedef struct vector3_##type { \ type a; \ type b; \ type c; \ }vector3_##type; /
阅读全文
posted @ 2020-03-18 20:35 hiligei
阅读(852)
评论(0)
推荐(0)
2020年3月16日
计算结构体内元素的偏移量宏
摘要: #define offsetof(type,member) ((size_t) &((type *)0)->member) 该宏定义含义为:在不生成结构体实例的情况下计算结构体成员的偏移量。 一:结构体变量的某成员的地址等于该结构体变量的基址加上结构体成员变量在结构体中的偏移量 二:#define
阅读全文
posted @ 2020-03-16 12:09 hiligei
阅读(1231)
评论(0)
推荐(0)
2020年3月13日
结构体初始化所遇到的问题
摘要: 一:变量的赋值和变量的初始化问题 变量赋值和变量初始化不是一回事! 变量赋值发生在运行期,其写法遵循赋值语法规定。 变量初始化发生在编译期或运行期,其写法遵循初始化列表语法规定。 局部变量是在函数内部所以它既可以初始化也可以赋值。 #include<stdio.h> #include<string.
阅读全文
posted @ 2020-03-13 14:39 hiligei
阅读(836)
评论(0)
推荐(0)
字符串赋值注意事项
摘要: 1.字符串指针变量赋值 #include<stdio.h> int main(){ char *b="azzzxxxddd"; b="azzzxxxdddccccc"; printf("%s", b); system("pause"); return 0; } 结果:没有报错,b赋值成功,正常输出。
阅读全文
posted @ 2020-03-13 13:56 hiligei
阅读(640)
评论(0)
推荐(1)
下一页
公告