当前位置:网站首页>结构体操作报错: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);边栏推荐
- 2022/07/25------字符串的排列
- INSTALL_ FAILED_ SHARED_ USER_ Incompatible error resolution
- IEEE conference upload font problem
- 抓包工具fiddler和wireshark对比
- The charm of SQL optimization! From 30248s to 0.001s
- Li Kou daily question 917
- 【socket】三次握手是在listen中完成,accept只从完成连接的队列中拿出一个连接
- Introduction to latex, EPS picture bounding box
- [Halcon vision] image filtering
- Review of database -- 1. Overview
猜你喜欢

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

Cause: could't make a guess for solution
软件打不开了

Employee information management system based on Web
![[qualcomm][network] QTI service analysis](/img/76/49054ff8c7215eca98cc479ab1d986.png)
[qualcomm][network] QTI service analysis

The difference between equals and = =

Learning about opencv (4)

Basics of data communication - basic knowledge of network

【Halcon视觉】编程逻辑

【Halcon视觉】形态学腐蚀
随机推荐
Redis realizes the correct posture of token bucket
【C#语言】具名类型和匿名类型
Agenda express | list of sub forum agenda on July 27
详细解析js中的混合方式构造对象(构造加属性,原型加方法)
Vs Code configures go locale and successfully installs go related plug-ins in vscode problem: Tools failed to install
INSTALL_ FAILED_ SHARED_ USER_ Incompatible error resolution
What will the new Fuzhou Xiamen railway bring to Fujian coastal areas?
Wechat official account release reminder (wechat official account template message interface)
畅听,网文流量竞争的下一站?
[qualcomm][network] QTI service analysis
js 获得当前时间,时间与时间戳的转换
Prevent XSS attacks
移动端双指缩放事件(原生),e.originalEvent.touches
How to write a million reading article
IEEE conference upload font problem
【Halcon视觉】软件编程思路
Using undertow, Nacos offline logout delay after service stop
Nacos custom service change subscription
The software cannot be opened
AirTest