LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: whshuai

关于scanf的问题

[复制链接]
发表于 2007-1-26 20:40:23 | 显示全部楼层
这里的 s 显然不用 free 的
回复 支持 反对

使用道具 举报

发表于 2007-1-26 21:25:02 | 显示全部楼层
man scanf:
  1.        a      (glibc)  Indicates that the conversion will be s, the needed memory space for the string will be malloc’ed
  2.               and the pointer to it will be assigned to the char pointer variable, which does not have to be initialized
  3.               before.  This flag does not exist in ANSI C (C89) and has a different meaning in C99.
  4.        a      (C99) Equivalent to f.
复制代码
回复 支持 反对

使用道具 举报

发表于 2007-1-27 13:02:43 | 显示全部楼层
这里的 s 显然需要 free 的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表