1 / 21
文档名称:

C语言库函数(S类字母) - 3.txt

格式:txt   页数:21
下载后只包含 1 个 TXT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

C语言库函数(S类字母) - 3.txt

上传人:中国课件站 2011/10/27 文件大小:0 KB

下载得到文件列表

C语言库函数(S类字母) - 3.txt

文档介绍

文档介绍:函数名: sound
功能: 以指定频率打开PC扬声器
用法: void sound(unsigned frequency);
程序例:
/* Emits a 7-Hz tone for 10 seconds.
Your PC may not be able to emit a 7-Hz tone. */
#include <>
int main(void)
{
sound(7);
delay(10000);
nosound();
return 0;
}
函数名: spawnl
功能: 创建并运行子程序
用法: int spawnl(int mode, char *pathname, char *arg0,
arg1, ... argn, NULL);
程序例:
#include <>
#include <>
#include <>
int main(void)
{
int result;
clrscr();
result = spawnl(P_WAIT, "", NULL);
if (result == -1)
{
perror("Error from spawnl");
exit(1);
}
return 0;
}
函数名: spawnle
功能: 创建并运行子程序
用法: int spawnle(int mode, char *pathname, char *arg0,
arg1,..., argn, NULL);
程序例:
/* spawnle() example */
#include <>
#include <>
#include <>
int main(void)
{
int result;
clrscr();
result = spawnle(P_WAIT, "", NULL, NULL);
if (result == -1)
{
perror("Error from spawnle");
exit(1);
}
return 0;
}
函数名: sprintf
功能: 送格式化输出到字符串中
用法: int sprintf(char *string, char *farmat [,argument,...]);
程序例:
#include <>
#include <>
int main(void)
{
char buffer[80];
sprintf(buffer, "An approximation of Pi is %f\n", M_PI);
puts(buffer);
return 0;
}
函数名: sqrt
功能: 计算平方根
用法: double sqrt(double x);
程序例:
#include <>
#include <>
int main(void)
{
double x = , result;
result = sqrt(x);
printf("The square root of %lf is %lf\n", x, result);
return 0;
}
函数名: srand
功能: 初始化随机数发生器
用法: void srand(unsigned seed);
程序例:
#include <>
#include <>
#include <>
int main(void)
{
int i;
time_t t;
srand((unsigned) time(&t));
printf("Ten random numbers from 0 to 99\n\n");
for(i=0; i<10; i++)
printf("%d\n", rand() % 100);
return 0;
}
函数名: sscanf
功能: 执行从字符串中的格式化输入
用法: int sscanf(char *string, char *format[,argument,...]);
程序例:
#include <>
#include <>
int main(void)
{
char label[20];
char name[20];
int entries = 0;
int loop, age;
double salary;
struc

最近更新

2024年安徽交通职业技术学院单招综合素质考试.. 40页

2026年企业人力资源服务合同 18页

2026年企业中秋活动方案 11页

2024年安徽新闻出版职业技术学院单招职业技能.. 39页

2024年安徽汽车职业技术学院单招职业技能考试.. 43页

2024年安徽省合肥市单招职业倾向性考试模拟测.. 42页

2024年安徽省淮南市单招职业倾向性考试题库附.. 40页

2026年以礼物为话题的作文800字 8页

2026年以春天话题作文 8页

2026年以思念亲人话题作文 8页

高效电镀电极材料 37页

2024年安徽警官职业学院单招职业倾向性考试模.. 41页

2024年宜昌科技职业学院单招职业技能测试题库.. 41页

2024年宣化科技职业学院单招职业倾向性测试模.. 42页

2024年山东化工职业学院单招职业倾向性考试题.. 40页

2024年山东旅游职业学院单招职业技能考试题库.. 42页

2024年山东省济宁市单招职业适应性测试模拟测.. 42页

2024年山东药品食品职业学院单招职业技能测试.. 40页

2024年山西卫生健康职业学院单招综合素质考试.. 41页

2024年山西林业职业技术学院单招职业技能考试.. 39页

2024年山西省晋中市单招职业倾向性考试模拟测.. 40页

2024年山西经贸职业学院单招职业倾向性测试题.. 39页

2024年山西警官职业学院单招职业适应性测试题.. 42页

2024年巴中职业技术学院单招综合素质考试模拟.. 39页

2024年常州机电职业技术学院单招职业技能测试.. 41页

2024年广东松山职业技术学院单招职业适应性考.. 41页

2024年广东省云浮市单招职业适应性考试模拟测.. 41页

2024年广东省汕尾市单招职业适应性测试模拟测.. 39页

2025年广州卫生职业技术学院单招职业技能测试.. 64页

美团代运营业务委托合同 6页