
C/C++
C/C++知识
hello青山
种一颗树最好的时间是十年前,其次是现在。
God helps those who help themselves.
展开
-
关于函数指针问题
最近在学unix环境高级编程,学习pthread_create创建线程函数,突然有个疑惑头文件 #include<pthread.h> 函数声明 int pthread_create(pthread_t *restrict tidp,const pthread_attr_t *restrict_attr,void*(*start_rtn)(void*),void *restrict arg);返回值 成功则返回0,否则返回出错编号 参数 第一个参数为指向原创 2020-08-06 11:01:17 · 337 阅读 · 0 评论 -
二级指针打印问题
``## 二级指针打印问题今天看pthread_join函数时发现函数的第二个参数是个二级指针,但是打印时用的确是一级指针打印#include<stdio.h>#include<pthread.h>#include"apue.h"void *thr_fn1(void *arg){ //printf("thr_fn1 tid1 = %lu\n",pthread_self()); printf("thread 1 returning\n"); ret原创 2020-07-29 18:03:22 · 1087 阅读 · 0 评论