新建
上传
首页
助手
最?/div>
资料?/div>
工具

精品文档

 

精品文档

 

 

二:改错题,只能在原来的基础上增加代码,不能删除代码

 

 

#include 

 

 

#include 

 

 

void foo(int age,char *b) 

 

{ 

 

 

 

 

b = (char *)malloc(64); 

 

 

 

 

sprintf(b,"Your Age is %d",age); 

 

} 

 

int main() 

 

{ 

 

 

 

char *f; 

 

 

 

foo(23,f); 

 

 

 

printf("%s\n",f); 

 

} 

 

答案

 

 

版本

1 

 

#include 

 

 

#include 

 

 

void foo(int age,char **b) 

 

{ 

 

 

 

 

*b = (char *)malloc(64); 

 

 

 

 

sprintf(*b,"Your Age is %d",age); 

Ͼλ
新建
上传
首页
助手
最?/div>
资料?/div>
工具

精品文档

 

精品文档

 

 

二:改错题,只能在原来的基础上增加代码,不能删除代码

 

 

#include 

 

 

#include 

 

 

void foo(int age,char *b) 

 

{ 

 

 

 

 

b = (char *)malloc(64); 

 

 

 

 

sprintf(b,"Your Age is %d",age); 

 

} 

 

int main() 

 

{ 

 

 

 

char *f; 

 

 

 

foo(23,f); 

 

 

 

printf("%s\n",f); 

 

} 

 

答案

 

 

版本

1 

 

#include 

 

 

#include 

 

 

void foo(int age,char **b) 

 

{ 

 

 

 

 

*b = (char *)malloc(64); 

 

 

 

 

sprintf(*b,"Your Age is %d",age); 

">
新建
上传
首页
助手
最?/div>
资料?/div>
工具

精品文档

 

精品文档

 

 

二:改错题,只能在原来的基础上增加代码,不能删除代码

 

 

#include 

 

 

#include 

 

 

void foo(int age,char *b) 

 

{ 

 

 

 

 

b = (char *)malloc(64); 

 

 

 

 

sprintf(b,"Your Age is %d",age); 

 

} 

 

int main() 

 

{ 

 

 

 

char *f; 

 

 

 

foo(23,f); 

 

 

 

printf("%s\n",f); 

 

} 

 

答案

 

 

版本

1 

 

#include 

 

 

#include 

 

 

void foo(int age,char **b) 

 

{ 

 

 

 

 

*b = (char *)malloc(64); 

 

 

 

 

sprintf(*b,"Your Age is %d",age); 

Ͼλ">
Ͼλ
Ŀ

最新CC++及数据结构笔试题集锦 - 百度文库
新建
上传
首页
助手
最?/div>
资料?/div>
工具

精品文档

 

精品文档

 

 

二:改错题,只能在原来的基础上增加代码,不能删除代码

 

 

#include 

 

 

#include 

 

 

void foo(int age,char *b) 

 

{ 

 

 

 

 

b = (char *)malloc(64); 

 

 

 

 

sprintf(b,"Your Age is %d",age); 

 

} 

 

int main() 

 

{ 

 

 

 

char *f; 

 

 

 

foo(23,f); 

 

 

 

printf("%s\n",f); 

 

} 

 

答案

 

 

版本

1 

 

#include 

 

 

#include 

 

 

void foo(int age,char **b) 

 

{ 

 

 

 

 

*b = (char *)malloc(64); 

 

 

 

 

sprintf(*b,"Your Age is %d",age); 



ļ׺.doc޸Ϊ.docĶ

  • ѵ
  • ڰ ּϵͳ()
  • Ķѧ̽ѧϰо⿪ⱨ桷
  • һ֤ļ
  • Сѧ꼶֮38 Ӧͬ⺬
  • ˽̰꼶ϲȫ̰(󶨽̲)
  • ߵȴҵ ڶʽ
  • 2008Ƹѧ߼ʦʾ
  • ̷_ѡ.
  • ĥúװҵָ

վ

԰ Ͼλ
ϵͷ779662525#qq.com(#滻Ϊ@)