用户管理  |   用户注册                                                                                    首 页软件下载教程中心办公指南flash动画文档下载办公公文

www.4oa.com - 中科软件园

投递文章 用户管理 投稿指南 资讯通告 :
站内搜索: 您的位置中科软件园 > 教程中心 > 程序设计 > C语言 > C语言函数库 > 教程内容

C语言函数大全(a开头)

2005-7-12 7:34:33  来源:本站整理  作者:不详 【 投递文章
内容提要:x);printf("Thearctangentof%lfis%lf\n",x,result);return(0);}函数名:atan2功能:计算Y/X的反正切值用法:doubleatan2(doub...
x);
printf("The arc tangent of %lf is %lf\n", x, result);
return(0);
}

函数名: atan2
功 能: 计算Y/X的反正切值
用 法: double atan2(double y, double x);
程序例:
#include
#include

int main(void)
{
double result;
double x = 90.0, y = 45.0;

result = atan2(y, x);
printf("The arc tangent ratio of %lf is %lf\n", (y / x), result);
return 0;
}

函数名: atexit
功 能: 注册终止函数
用 法: int atexit(atexit_t func);
程序例:
#include
#include

void exit_fn1(void)
{
printf("Exit function #1 called\n");
}

void exit_fn2(void)
{
printf("Exit function #2 called\n");
}

int main(void)
{
/* post exit function #1 */
atexit(exit_fn1);
/* post exit function #2 */
atexit(exit_fn2);
return 0;
}


函数名: atof
功 能: 把字符串转换成浮点数
用 法: double atof(const char *nptr);
程序例:
#include
#include

int main(void)
{
float f;
char *str = "12345.67";

f = atof(str);
printf("string = %s float = %f\n", str, f);
return 0;
}

函数名: atoi
功 能: 把字符串转换成长整型数
用 法: int atoi(const char *nptr);
程序例:
#include
#include

int main(void)
{
int n;
char *str = "12345.67";

n = atoi(str);
printf("string = %s integer = %d\n", str, n);
return 0;
}

函数名: atol
功 能: 把字符串转换成长整型数
用 法: long atol(const char *nptr);
程序例:

#include
#include

int main(void)
{
long l;
char *str = "98765432";

l = atol(lstr);
printf("string = %s integer = %ld\n", str, l);
return(0);
}

上一页  [1] [2] 

(评论内容只代表网友观点,与本站立场无关!)[ 全部评论 ]

网友评论:

    用户名:

    评   分:100分 85分 70分 55分 40分 25分 10分 0分

    内 容:

                 (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 -有事点这里