
标准库函数
|
543
标准库
函数
printf( "\nHow many people? ");
scanf( "%lf", &people );
printf( "\nHow many apples? ");
scanf( "%lf", &apples );
left =
remainder
( apples, people ); // left
可能为负
share = ( apples
-
left ) / people;
printf( "If there are %.1lf of us and %.1lf apples, "
"each of us gets %.1lf of %s, with %.1lf left over.\n",
people, apples, share, ( share < 1 ) ? "one" : "them", left );
相关函数
remquo()
、
fmod()
。
remove
解除一个文件的链接。
#include <stdio.h>
int
remove
( const char
*filename
);
函数
remove()
删除其字符串参数所引用的文件(或目录)。准确地说,函数仅仅“解
除”与该文件的链接,即从文件系统中删除该文件名,但是如果该文件链接到多个名
称,仅仅删除其中一个链接,但没有删除该文件的内容。
如果文件处于打开状态,函数
remove()
可能会无法删除一个文件链接,不同实现版本有
所差异。如果操作成功,则函数返回
0
;如果操作失败,则函数返回一个非零值。 ...