LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 475|回复: 2

请达人详解~~

[复制链接]
发表于 2004-11-1 20:26:16 | 显示全部楼层 |阅读模式
how to use the functions "sprintf()"and"sscanf()"??
i'm not sure the mean of these parameters~~
help me~~thx~~~

or explain the following codes:
  1. sprintf(buffer,"%d",file_pipes[0]);
  2. sscanf(argv[1],"%d",&file_descriptor);
复制代码


thx!!  
发表于 2004-11-1 20:35:46 | 显示全部楼层
The sprintf function is equivalent to fprintf, except that the output is written into an array (specified by the argument s) rather than to a stream. A null character is written at the end of the characters written; it is not counted as part of the returned value. If copying takes place between objects that overlap, the behavior is undefined.

The sscanf function is equivalent to fscanf, except that input is obtained from a string (specified by the argument s) rather than from a stream. Reaching the end of the string is equivalent to encountering end-of-file for the fscanf function. If copying takes place between objects that overlap, the behavior is undefined.

-- from ISO/IEC 9899:1999, Programming languages - C
 楼主| 发表于 2004-11-1 21:12:13 | 显示全部楼层
O~~it's too hard to read~~T_T
luckily,i have an electronic dictionary~~
though it spends me too much time,i'm very happy for the new knowledge and your answer!!!!!   
thk you!!!  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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