| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
-  struct student *p1;
 
 -         p1= malloc(sizeof(struct student));
 
  复制代码 ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑我自己写的↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑  
 
- struct student *p1, *p2;
 
 -       p1 = p2 = (struct student *)malloc(sizeof(struct student) );
 
  复制代码 ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑小甲鱼老师↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ 
 
小甲鱼老师 零基础入门学习C语言  056课->10:01对这里没有细说 malloc 的使用方法。 
 
上面两个malloc函数的使用方法有什么区别呢? 
 
我重点是不明白,老师在在malloc前加的(struct student *)是干什么用的。我觉得很有必要弄清楚这个,毕竟小甲鱼老师 
不可能做无用功吧,否则,我就推倒他。。{:2_27:} 
 |   
 
评分
- 
|  参与人数 1 | 荣誉 +2 | 
鱼币 +10 | 
贡献 +5 | 
收起
理由
 | 
 
  番茄
 |  + 2 | 
 + 10 | 
 + 5 | 
细心在学习 | 
 
 
查看全部评分
 
 
 
 
 
 |