#include <stdio.h>
char *Get(void)
{
char p[]="hello world";
return p;
}
int main(void)
{
char *str=NULL;
str=Get();
printf(str);
}
6楼
这样可能是你想要的结果!!
char *Get(void)
{
char p[]="hello world";
char *a;
strcpy(a,p);
return a;
}
int main(void)
{
char *str=NULL;
str=Get();
printf(str);
getch();
}
char *Get(void)
{
char p[]="hello world";
char *a;
strcpy(a,p);
return a;
}
int main(void)
{
char *str=NULL;
str=Get();
printf(str);
getch();
}
10楼
char *Get(void)
{
char p[]="hello world";
return p;
}
这个函数在这里取什么作用,怎么看不明白了?
回复
我要赚赏金打赏帖 |
|
|---|---|
| bsp_log:RTT分级日志封装被打赏¥16元 | |
| J-LinkRTT常用API函数讲解被打赏¥14元 | |
| 【S32K3学习整理】S32K388 四核启动被打赏¥23元 | |
| 【S32K3学习整理】Lockstep和Decoupled 模式被打赏¥28元 | |
| 嵌入式芯片调试神器-J-LinkRTT被打赏¥21元 | |
| 人体红外PIR感应传感器使用(ESP32S3)被打赏¥26元 | |
| 一种有效完成脚本程序测试的方法被打赏¥28元 | |
| WorkBuddy搭配SolidCraft给开发板做两件式外壳被打赏¥33元 | |
| 开箱一块k230被打赏¥33元 | |
| 【瑞萨RA8D1测评】RA8D1+lwIP网络验证与TCPOTA的实验记录被打赏¥33元 | |
我要赚赏金
