当前位置:网站首页>如何通过函数返回数组首地址
如何通过函数返回数组首地址
2022-07-20 10:58:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
int * scanffile(FILE *fp,int n){ int i; static
int array[10]; //因为array是局部变量,随scanffile()函数的结束,该内存被释放,因此,你在之后得不到相应的数据了。 改成static静态变量就可以了!
for(i=0;i<n;i++){ fscanf(fp,”%d\t”,&array[i]); } for(i=0;i<5;i++) printf(“%d\t”,array[i]); return array; }
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/108598.html原文链接:https://javaforall.cn
边栏推荐
- Wallys/3×3/2×2 MIMO/ 802.11ac/ Mini PCIe /2,4GHz / 5GHz QCA 9880
- 苏州见!“云智技术论坛-工业专场”举办在即
- Rearrange characters of leetcode simple question to form target string
- VRRP虚拟冗余协议配置
- 第一章 第五节:注释的重要性
- Exchange 2010 SSL certificate installation document
- Iron nails pierce the head, yogurt bottles "bite" the tongue... Guangdong fire: Summer children's safety can not be ignored
- Industrial control safety PLC firmware reverse I
- 标量、向量、矩阵微积分
- PostgreSQL中按时间月份自动创建分区表
猜你喜欢
General GUI large disk based on MCU
Football team tour - Premier League West Ham United
I/o reuse: select poll epoll
Every time the Epson invoice printer continuously prints invoices, the page jumps with a blank in the middle
VRRP虚拟冗余协议配置
Wps2019 all macros are forbidden. You have to pay for enabling macros. How to use them for free
Notes....
第一章第十节:条件判断 if
着力提升妇儿获得感、幸福感、安全感!未来十年广州妇女儿童事业这样发力
第一章第十一节:循环语句while
随机推荐
Mg black logo will promote new product series
Flink battle: consume Wikipedia real-time messages
云原生(八) | Devops篇之深入Devops
被大厂强制毕业,两个月空窗期死背八股文,幸好上岸,不然房贷都还不上了
Section 7 of Chapter 1: constants
第一章第七节:常量
第一章第八节:简单了解数据类型
Node uninstall
Wallys/DR882/QCA9882/ AC/AN MiniPCIE/2×2.4GHz 2x5GHz MT7915 MT7975
第一章 第十二节:break,continue的使用
Section 10 of Chapter 1: conditional judgment if
[go open source treasure] performance tuning skills based on golang syntax (array traversal)
Understand what configuration center is?
关于父进程和子进程的关系(UAC 绕过思路)
第一章 第六节:变量
运算符优先级与求值次序(从上至下)
DDR 6 memory has been put into research and development
6-11漏洞利用-利用搭建环境发送邮件
VRRP虚拟冗余协议配置
有什麼好玩的網頁小遊戲網站推薦麼?