![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
关于C语言的一些细节
Ho_Yim
Pointers are everything.
展开
-
嵌入式C面试题
【代码】嵌入式C面试题。原创 2023-05-05 18:05:06 · 129 阅读 · 0 评论 -
Windows下cmake生成dll文件
cmake dll windows原创 2023-01-06 19:49:37 · 3727 阅读 · 0 评论 -
Windows下Cmake的简易工程构建
windows下的cmake简单示例原创 2023-01-01 14:15:26 · 814 阅读 · 0 评论 -
关于指针函数,我有些话要说
#include "stdio.h"int c = 100;int* add(int a,int b) //一段特殊的内存,它存放的是自己地址{ c = a + b; return &c; }int* (*Add)(int,int); //申明一个函数指针int main(void){ Add = add; //Add是一个指针变量,存放了指针函数(一个指针)的内容 printf(" &c:%p\n\n",&c原创 2022-04-15 09:49:40 · 61 阅读 · 0 评论 -
C语言指针综合应用
#include "stdio.h"#include "malloc.h"typedef char* string;typedef struct Calculator{ void *pointer; void (*PRINT)(int); //定义函数指针,此处不能再使用typedef int (*ADD)(int,int); //使用时需要初始化一个变量出来}Cal; //这种结构体不能用malloc函数初始化变量/*****************************原创 2022-04-13 21:20:19 · 529 阅读 · 0 评论 -
typedef void (*p)(void)说明
#include "stdio.h"void print(void){ printf("print\n");}void PRINT(void){ printf("PRINT\n");}//定义了一个别名为p0的函数指针typedef void (*p0)(void); //使用时要定义一个变量p0 p;/*******************************************************************/int (*p1)(int c,in原创 2022-04-13 19:47:22 · 1449 阅读 · 0 评论 -
define和typedef
#include "stdio.h"//#define string char* //只能替换,定义string str1 = "hello",str2 = "world",则会报错typedef char* string; //给类型起别名,且定义string str1 = "hello",str2 = "world"不会出错int main(void){ string str1 = "hello",str2 = "world"; printf("%s\n",str1); printf原创 2022-04-13 19:40:27 · 61 阅读 · 0 评论 -
C语言结构体函数指针
#include <stdio.h>#include <malloc.h>typedef struct Value //只有结构体变量才分配地址,而结构体的定义是不分配空间的{ int dat; char str;}Value;typedef struct Fun{ //只有结构体变量才分配地址,而结构体的定义是不分配空间的 int a,b; int m,n; void(*print)(void); //函数指针,是一个指针变量,指向某个函数的地址,原创 2022-04-13 18:55:37 · 2029 阅读 · 0 评论 -
函数指针,指针函数,void *p指针
C语言原创 2022-04-13 15:42:26 · 224 阅读 · 0 评论