当前位置:网站首页>结构体操作报错:Segmentation fault (core dumped)
结构体操作报错:Segmentation fault (core dumped)
2022-07-26 10:25:00 【青云 --小凡】
原因:结构体必须初始化才可以使用,包括结构体中嵌套的结构体,结构体中嵌套的结构体的结构体。
otaTaskInstruction_t *ota = malloc(sizeof(otaTaskInstruction_t));
ota->taskArray = malloc(sizeof(ota->taskArray));
ota->taskArray->fileInfoArray = malloc(sizeof(ota->taskArray->fileInfoArray));
printf("000000\n");
const char *name = "12312";
// ota.taskArray->fileInfoArray = malloc(sizeof(ota.taskArray->fileInfoArray));
ota->taskArray->fileInfoArray->fileLevelName = name;
printf("111111\n");
// task_instruction_add->taskArray->fileInfoArray->fileName = "filename";
printf("-----%s\n", ota->taskArray->fileInfoArray->fileLevelName);边栏推荐
- 点赞,《新程序员》电子书限时免费领啦!
- Okaleido生态核心权益OKA,尽在聚变Mining模式
- SQL Server 2008 server engine failed to start?
- 上传图片获取宽高
- Use spiel expressions in custom annotations to dynamically obtain method parameters or execute methods
- 数通基础-Telnet远程管理设备
- 微信公众号发布提醒(微信公众号模板消息接口)
- js下载文件,FileSaver.js导出txt、excel文件
- Flask框架初学-04-flask蓝图及代码抽离
- The software cannot be opened
猜你喜欢
![[Halcon vision] morphological corrosion](/img/f9/f01dd3340824ff28c84cf7bb52882e.png)
[Halcon vision] morphological corrosion

数通基础-网络基础知识

Cause: couldn‘t make a guess for 解决方法

SAP ABAP Netweaver 容器化的一些前沿性研究工作分享

Cause: could't make a guess for solution

Learning about tensorflow (I)

Data communication foundation TCPIP reference model

Data communication foundation telnet remote management equipment

Necessary for beginners: debug breakpoint debugging skills in idea and common breakpoint skills

Learning about opencv (1)
随机推荐
Dynamically determine file types through links
Wechat official account release reminder (wechat official account template message interface)
About the declaration and definition of template functions [easy to understand]
[Halcon vision] image filtering
新建福厦铁路全线贯通 这将给福建沿海带来什么?
软件打不开了
The problem of four columns of Hanoi Tower
[gossip] error loading psychopg2 module: no module named psychopg2
Cause: couldn‘t make a guess for 解决方法
PTA class a 1002
RecyclerView最后一条显示不全或显示部分的问题解决
汉诺塔II|汉诺塔4柱
On the compilation of student management system of C language course (simple version)
What will the new Fuzhou Xiamen railway bring to Fujian coastal areas?
[C language] named type and anonymous type
SPARK中 DS V2 push down(下推)的一些说明
Use spiel expressions in custom annotations to dynamically obtain method parameters or execute methods
数据库的复习--1.概述
Tower of Hanoi II | tower of Hanoi 4 columns
Learning about tensorflow (I)