随笔分类 - C语言设计模式
摘要:#ifndef QUEUE_H #define QUEUE_H #define QUEUE_SIZE 10 typedef struct queue { int buffer[QUEUE_SIZE]; int head; int size; int tail; int (*isFull)(struct queue* const me); in...
阅读全文
摘要:NBModule.h NBModule.c main.c 面向对象的方法将两者结合,当低耦合时,为固有紧密耦合的元素和内容的封装提高内聚力。C不是面向对象语言,可以用于开发基于对象或面向对象的嵌入式系统。
阅读全文
摘要:#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) typedef int (*parse_func)(const char *data,size_t len); struct parse_handler{ int type; parse_func func; } static int parse_temperature(const...
阅读全文