?? fa.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb_2312-80">
<meta name="Author" content="wdg">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>網(wǎng)上學(xué)堂 --> C語言編程寶典之一 -->函數(shù)名: a</title>
</head>
<body>
<div align="center"><center>
<table border="1" cellpadding="4" width="640"
bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
<tr>
<td bgcolor="#FFE6B0" bordercolor="#8080FF" class="p9"><font
color="#BB0000">導(dǎo)航條:--></font> <a
href="../../index.html">網(wǎng)上學(xué)堂</a> --> <a
href="../tcindex.htm"><font face="宋體">C</font>語言編程寶典之一</a>
-->函數(shù)名: a</td>
</tr>
<tr>
<td bordercolor="#8080FF" class="p9">函數(shù)名: abort <br>
功 能: 異常終止一個進程 <br>
用 法: void abort(void); <br>
程序例: <br>
#include <stdio.h> <br>
#include <stdlib.h> <p>int main(void) <br>
{ <br>
printf("Calling abort()\n"); <br>
abort(); <br>
return 0; /* This is never reached */ <br>
} <br>
<br>
</p>
<p>函數(shù)名: abs <br>
功 能: 求整數(shù)的絕對值 <br>
用 法: int abs(int i); <br>
程序例: <br>
#include <stdio.h> <br>
#include <math.h> </p>
<p>int main(void) <br>
{ <br>
int number = -1234; </p>
<p> printf("number: %d absolute value:
%d\n", number, abs(number)); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函數(shù)名: absread, abswirte <br>
功 能: 絕對磁盤扇區(qū)讀、寫數(shù)據(jù) <br>
用 法: int absread(int drive, int nsects, int
sectno, void *buffer); <br>
int abswrite(int drive, int nsects, in tsectno,
void *buffer); <br>
程序例: <br>
/* absread example */ </p>
<p>#include <stdio.h> <br>
#include <conio.h> <br>
#include <process.h> <br>
#include <dos.h> </p>
<p>int main(void) <br>
{ <br>
int i, strt, ch_out, sector; <br>
char buf[512]; </p>
<p> printf("Insert a diskette into drive A and
press any key\n"); <br>
getch(); <br>
sector = 0; <br>
if (absread(0, 1, sector, &buf) != 0) <br>
{ <br>
perror("Disk
problem"); <br>
exit(1); <br>
} <br>
printf("Read OK\n"); <br>
strt = 3; <br>
for (i=0; i<80; i++) <br>
{ <br>
ch_out = buf[strt+i]; <br>
putchar(ch_out); <br>
} <br>
printf("\n"); <br>
return(0); <br>
} <br>
<br>
<br>
</p>
<p>函數(shù)名: access <br>
功 能: 確定文件的訪問權(quán)限 <br>
用 法: int access(const char *filename, int
amode); <br>
程序例: <br>
#include <stdio.h> <br>
#include <io.h> </p>
<p>int file_exists(char *filename); </p>
<p>int main(void) <br>
{ <br>
printf("Does NOTEXIST.FIL exist: %s\n", <br>
file_exists("NOTEXISTS.FIL") ?
"YES" : "NO"); <br>
return 0; <br>
} </p>
<p>int file_exists(char *filename) <br>
{ <br>
return (access(filename, 0) == 0); <br>
} <br>
</p>
<p>函數(shù)名: acos <br>
功 能: 反余弦函數(shù) <br>
用 法: double acos(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 = acos(x); <br>
printf("The arc cosine of %lf is %lf\n",
x, result); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函數(shù)名: allocmem <br>
功 能: 分配DOS存儲段 <br>
用 法: int allocmem(unsigned size, unsigned
*seg); <br>
程序例: <br>
#include <dos.h> <br>
#include <alloc.h> <br>
#include <stdio.h> </p>
<p>int main(void) <br>
{ <br>
unsigned int size, segp; <br>
int stat; </p>
<p> size = 64; /* (64 x 16) = 1024 bytes */ <br>
stat = allocmem(size, &segp); <br>
if (stat == -1) <br>
printf("Allocated memory at
segment: %x\n", segp); <br>
else <br>
printf("Failed: maximum
number of paragraphs available is %u\n", <br>
stat); </p>
<p> return 0; <br>
} <br>
<br>
</p>
<p>函數(shù)名: arc <br>
功 能: 畫一弧線 <br>
用 法: void far arc(int x, int y, int stangle,
int endangle, int radius); <br>
程序例: <br>
#include <graphics.h> <br>
#include <stdlib.h> <br>
#include <stdio.h> <br>
#include <conio.h> </p>
<p>int main(void) <br>
{ <br>
/* request auto detection */ <br>
int gdriver = DETECT, gmode, errorcode; <br>
int midx, midy; <br>
int stangle = 45, endangle = 135; <br>
int radius = 100; </p>
<p> /* initialize graphics and local
variables */ <br>
initgraph(&gdriver, &gmode,
""); </p>
<p> /* read result of initialization */ <br>
errorcode = graphresult();
/* an error occurred */ <br>
if (errorcode != grOk) <br>
{ <br>
printf("Graphics
error: %s\n", grapherrormsg(errorcode)); <br>
printf("Press any key
to halt:"); <br>
getch(); </p>
<p> exit(1);
/* terminate with an error code */ <br>
} </p>
<p> midx = getmaxx() / 2; <br>
midy = getmaxy() / 2; <br>
setcolor(getmaxcolor()); </p>
<p> /* draw arc */ <br>
arc(midx, midy, stangle, endangle, radius); </p>
<p> /* clean up */ <br>
getch(); <br>
closegraph(); <br>
return 0; <br>
} <br>
<br>
</p>
<p>函數(shù)名: asctime <br>
功 能: 轉(zhuǎn)換日期和時間為ASCII碼 <br>
用 法: char *asctime(const struct tm *tblock); <br>
程序例: <br>
#include <stdio.h> <br>
#include <string.h> <br>
#include <time.h> </p>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -