这是函数指针?typedef int delete_dir_cb( char* path, int action, int succ,);

feidegengao 2012-12-04 08:53:08
这是函数指针呀?typedef int delete_dir_cb( char* path, int action, int succ);
不是是这样呀?

typedef int (*delet_dir_cb)( char* path, int action, int succ);
...全文
1137 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
whizer 2012-12-05
  • 打赏
  • 举报
回复

typedef int  delete_dir_cb( char* path, int action, int succ); //函数类型
typedef int (*delet_dir_cb)( char* path, int action, int succ);//函数类型指针
参见下面C99标准描述:

typedef int F(void); // type F is ‘‘function with no parameters
                     // returning int’’
EXAMPLE 4 On the other hand, typedef names can be used to improve code readability. All three of the following declarations of the signal function specify exactly the same type, the first without making use of any typedef names.

typedef void fv(int), (*pfv)(int);
void (*signal(int, void (*)(int)))(int);
fv *signal(int, fv *);
pfv signal(int, pfv); 
自信男孩 2012-12-04
  • 打赏
  • 举报
回复
一般指针都是占4个字节(在32位系统中),你可以sizeof();一下:

#include <stdio.h>

typedef int  delete_dir_cb( char* path, int action, int succ);
typedef int (*delete_dir_cb2(char *path, int action, int succ);
int main(int argc, char *argv[])
{
	delete_dir_cb num;
	delete_dir_cb2 num2;
	printf("sizeof(num) = %d\n", sizeof(num));
	printf("sizeof(num2) = %d\n", sizeof(num2));
	return 0;
}
自信男孩 2012-12-04
  • 打赏
  • 举报
回复
typedef int (*delet_dir_cb)( char* path, int action, int succ); 这个是一个函数指针。
内容概要:该文档为一段用于Google Earth Engine(GEE)平台的JavaScript代码脚本,旨在对研究区域(AOI)内的Landsat 8卫星影像进行土地利用/土地覆盖(LULC)分类。脚本首先筛选2024年云量低于10%的Landsat 8 Level-2地表反射率影像,构建中值合成影像并应用缩放因子校正。随后,基于预先定义的水体(Water)和植被(Vegetation)样本点,合并训练样本并提取影像对应波段数据,采用随机森林分类器(smileRandomForest)对影像进行监督分类。最后,通过划分训练集与测试集,输出混淆矩阵、总体分类精度和Kappa系数,完成分类结果的精度评估。; 适合人群:具备遥感图像处理基础知识的科研人员、地理信息系统(GIS)技术人员以及环境监测相关领域的研究生或专业人员;熟悉GEE平台基本操作者更佳; 使用场景及目标:①实现特定区域多光谱遥感影像的土地覆盖分类;②掌握GEE平台上从影像预处理、样本构建、模型训练到精度验证的完整分类流程;③支持水资源管理、生态环境监测等应用领域的空间数据分析; 阅读建议:此资源以实际代码形式呈现,建议结合GEE开发环境边运行边学习,重点关注影像预处理方法、训练样本构建逻辑、分类器参数设置及精度评估指标解读,便于迁移应用于其他区域或传感器数据。

70,026

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧