【正文】
= random(maxx)。 } delay(DELAY_TIME)。 i++) { x = random(maxx)。 } } /* clean up */ getch()。 程序例 : include int main(void) { char string[] = This is an example output string\n。 程序例 : include int main(void) { char buffer[512]。 getch()。 puttext(20, 12, 36, 21, buffer)。 程序例 : include include define FNAME test.$$$ int main(void) { FILE *fp。 exit(1)。 else printf(Successful write\n)。 exit(1)。 /* clean up */ fclose(fp)。 程序例 : include include include int sort_function( const void *a, const void *b)。 for (x = 0。 } int sort_function( const void *a, const void *b) { return( strcmp(a,b) )。 b = 0。 } 函數(shù)名 : rand 功 能 : 隨機(jī)數(shù)發(fā)生器 用 法 : void rand(void)。 i10。 程序例 : include include include include int main(void) { char far *save_dta。 /* get user input file name for dta */ printf(Enter drive and file name (no path . a:)\n)。 exit(1)。 /* save old dta, and set new one */ save_dta = getdta()。 result = randbrd(amp。 exit(1)。 i++) putchar(buffer[i])。 程序例 : include include include include int main(void) { char far *save_dta。 int result。blk,1)。 exit(1)。 = 0L。 else { perror(Disk error)。 exit(1)。 程序例 : include include include /* prints a random number in the range 0 to 99 */ int main(void) { randomize()。 程序例 : include include include int main(void) { int i。 i10。 程序例 : include include include include include include sys\ int main(void) { void *buf。 exit(1)。 } return 0。 /* copy Hello into string */ strcpy(str, Hello)。 /* free memory */ free(str)。 int left, top, right, bottom。 /* read result of initialization */ errorcode = graphresult()。 exit(1)。 bottom = getmaxy() / 2 + 50。 return 0。 /* report any registration errors */ if (errorcode 0) { printf(Graphics error: %s\n, grapherrormsg(errorcode))。 /* terminate with an error code */ } /* initialize graphics and local variables */ initgraph(amp。 if (errorcode != grOk) /* an error occurred */ { printf(Graphics error: %s\n, grapherrormsg(errorcode))。 /* terminate with an error code */ } /* draw a line */ line(0, 0, getmaxx(), getmaxy())。 } 函數(shù)名 : remove 功 能 : 刪除一個(gè)文件 用 法 : int remove(char *filename)。 /* delete the file */ if (remove(file) == 0) printf(Removed %s.\n,file)。 程序例 : include int main(void) { char oldname[80], newname[80]。 gets(newname)。 } 函數(shù)名 : restorecrtmode 功 能 : 將屏幕模式恢復(fù)為先前的 imitgraph 設(shè)置 用 法 : void far restorecrtmode(void)。gdriver, amp。 printf(Press any key to halt:)。 y = getmaxy() / 2。 /* restore system to text mode */ restorecrtmode()。 getch()。re back in graphics mode.)。 return 0。 /* clean up */ getch()。 /* output a message */ settextjustify(CENTER_TEXT, CENTER_TEXT)。re now in text mode.\n)。 outtextxy(x, y, Press any key to exit graphics:)。 exit(1)。 /* read result of initialization */ errorcode = graphresult()。 int x, y。 else perror(rename)。 gets(oldname)。 return 0。 /* prompt for file name to delete */ printf(File to delete: )。 closegraph()。 getch()。gmode, )。 getch()。 程序例 : include include include include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode。 /* clean up */ getch()。 top = getmaxy() / 2 50。 printf(Press any key to halt:)。gdriver, amp。 } 函數(shù)名 : rectangle 功 能 : 畫一個(gè)矩形 用 法 : void far rectangle(int left, int top, int right, int bottom)。 str = realloc(str, 20)。 程序例 : include include include int main(void) { char *str。 exit(1)。 buf = malloc(10)。 return 0。 printf(Ten random numbers from 0 to 99\n\n)。 return 0。 return 0。 } /* request DOS services to close the file */ if (bdosptr(0x10, amp。blk, 1)。 setdta(buffer)。 /* request DOS services to create file */ if (bdosptr(0x16, amp。 gets(line)。 char buffer[256] = RANDBWR test!。 return 0。 for (i=0。 /* check results from randbrd */ if (!result) printf(Read OK\n\n)。 /* set up info for the new dta */ = 128。 /* open file with DOS FCB open file */ bdosptr(0x0F, amp。 /* put file name in fcb */ if (!parsfnm(line, amp。 struct fcb blk。 return 0。 printf(Ten random numbers from 0 to 99\n\n)。 a = a / b。 程序例 : include int main(void) { int a, b。 x++) printf(%s\n, list[x])。 int main(void) { int x。 return 0。 if (ferror(fp)) printf(Error reading file\n)。 /* reopen the file */ fp = fopen(FNAME, rb)。 putw(word,fp)。 /* place the word in a file */ fp = fopen(FNA