📄 fa.htm
字号:
<p>int main(void) <br>
{ <br>
struct tm t; <br>
char str[80]; </p>
<p> /* sample loading of tm structure
*/ </p>
<p> t.tm_sec = 1; /*
Seconds */ <br>
t.tm_min = 30; /* Minutes
*/ <br>
t.tm_hour = 9; /* Hour */ <br>
t.tm_mday = 22; /* Day of the
Month */ <br>
t.tm_mon = 11; /* Month */
<br>
t.tm_year = 56; /* Year - does
not include century */ <br>
t.tm_wday = 4; /* Day of
the week */ <br>
t.tm_yday = 0; /* Does not
show in asctime */ <br>
t.tm_isdst = 0; /* Is Daylight
SavTime; does not show in asctime */ </p>
<p> /* converts structure to null terminated <br>
string */ </p>
<p> strcpy(str, asctime(&t)); <br>
printf("%s\n", str); </p>
<p> return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: asin <br>
功 能: 反正弦函数 <br>
用 法: double asin(double x); <br>
程序例: <br>
#include <stdio.h> <br>
#include <math.h> </p>
<p>int main(void) <br>
{ <br>
double result; <br>
double x = 0.5; </p>
<p> result = asin(x); <br>
printf("The arc sin of %lf is
%lf\n", x, result); <br>
return(0); <br>
} <br>
<br>
<br>
</p>
<p>函数名: assert <br>
功 能: 测试一个条件并可能使程序终止
<br>
用 法: void assert(int test); <br>
程序例: <br>
#include <assert.h> <br>
#include <stdio.h> <br>
#include <stdlib.h> </p>
<p>struct ITEM { <br>
int key; <br>
int value; <br>
}; </p>
<p>/* add item to list, make sure list is not null */ <br>
void additem(struct ITEM *itemptr) { <br>
assert(itemptr != NULL); <br>
/* add item to list */ <br>
} </p>
<p>int main(void) <br>
{ <br>
additem(NULL); <br>
return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: atan <br>
功 能: 反正切函数 <br>
用 法: double atan(double x); <br>
程序例: <br>
#include <stdio.h> <br>
#include <math.h> </p>
<p>int main(void) <br>
{ <br>
double result; <br>
double x = 0.5; </p>
<p> result = atan(x); <br>
printf("The arc tangent of %lf is
%lf\n", x, result); <br>
return(0); <br>
} <br>
<br>
</p>
<p>函数名: atan2 <br>
功 能: 计算Y/X的反正切值 <br>
用 法: double atan2(double y, double x); <br>
程序例: <br>
#include <stdio.h> <br>
#include <math.h> </p>
<p>int main(void) <br>
{ <br>
double result; <br>
double x = 90.0, y = 45.0; </p>
<p> result = atan2(y, x); <br>
printf("The arc tangent ratio of %lf is
%lf\n", (y / x), result); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函数名: atexit <br>
功 能: 注册终止函数 <br>
用 法: int atexit(atexit_t func); <br>
程序例: <br>
#include <stdio.h> <br>
#include <stdlib.h> </p>
<p>void exit_fn1(void) <br>
{ <br>
printf("Exit function #1
called\n"); <br>
} </p>
<p>void exit_fn2(void) <br>
{ <br>
printf("Exit function #2
called\n"); <br>
} </p>
<p>int main(void) <br>
{ <br>
/* post exit function #1 */ <br>
atexit(exit_fn1); <br>
/* post exit function #2 */ <br>
atexit(exit_fn2); <br>
return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: atof <br>
功 能: 把字符串转换成浮点数 <br>
用 法: double atof(const char *nptr); <br>
程序例: <br>
#include <stdlib.h> <br>
#include <stdio.h> </p>
<p>int main(void) <br>
{ <br>
float f; <br>
char *str = "12345.67"; </p>
<p> f = atof(str); <br>
printf("string = %s float = %f\n",
str, f); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函数名: atoi <br>
功 能: 把字符串转换成长整型数 <br>
用 法: int atoi(const char *nptr); <br>
程序例: <br>
#include <stdlib.h> <br>
#include <stdio.h> </p>
<p>int main(void) <br>
{ <br>
int n; <br>
char *str = "12345.67"; </p>
<p> n = atoi(str); <br>
printf("string = %s integer =
%d\n", str, n); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函数名: atol <br>
功 能: 把字符串转换成长整型数 <br>
用 法: long atol(const char *nptr); <br>
程序例: </p>
<p>#include <stdlib.h> <br>
#include <stdio.h> </p>
<p>int main(void) <br>
{ <br>
long l; <br>
char *str = "98765432"; </p>
<p> l = atol(lstr); <br>
printf("string = %s integer =
%ld\n", str, l); <br>
return(0); <br>
} <br>
</p>
</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" cellspacing="1" width="640">
<tr>
<td class="p9" height="60"> <script>document.write("<p><a href=\"http://view.gznet.com/cgi-bin/rl_views.cgi?UID=10013421\" target=sxrl>");
document.write("<img src=\"http://refer.gznet.com/cgi-bin/rl_refer2.cgi?UID=10013421&refer="+escape(top.document.referrer)+"\" width=1 height=1 border=0 alt=\" \">");
document.write("</a>");
</script></td>
</tr>
</table>
</center></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -