Click here to load reader

第 13 章 C 语言综合应用程序设计

  • Upload
    zocha

  • View
    121

  • Download
    0

Embed Size (px)

DESCRIPTION

第 13 章 C 语言综合应用程序设计. 13.1 多模块程序设计基础. 13.2 图形处理基础. 13.3 操作系统接口. 13.4 C 程序中的汉字显示技术. 13.1 多模块程序设计基础. 一 . 多模块程序的建立. 使用多模块编程技术的处理过程大致如下: - PowerPoint PPT Presentation

Citation preview

  • 13 C13.1 13.2 13.3 13.4 C

  • 11.1 13.1 . .Cfile1.cfile2.cfile3.c....OBJ

  • #include #include file2.c /*file2.cfile1.c*/void main(){ A2();}file2.c#include void A2(){}file1.cfile2.c.1includefile1.c 11.1

  • Turbo C.prj2project file1.cfile1.cfile1.c 11.1

  • 13-1file1.cfile2.cfile3.cfile4.cfile1.cijmaxminaveragefile2.cfile3.cfile4.c 11.1

  • 1.prj .prjCfile1.cfile2.cfile3.cfile4.c /* .c */ .prjfile.prj 11.1

  • 2 Project/Project name13-1file.prjfile.prjCtrl-F9Compile/Compile to OBJfile.prjfile.exe3Run/Runfile.exe 11.1

  • Cfunction1()/*file1.c*/{ extern int student }extern int student/*file2.*/ fun1(){student=50} 11.1

  • 13.2 . att.bgicga.bgiegavga.bgiherc.bgi ibm8514.bgipc3270.bgi bgiobj.exe.

    Cinitgraph

    11.2

  • . 11.2

  • 11initgraphvoid far initgraph(int far *graphdriverint far *graphmodechar far *path)int graphdriver=EGAint graphmode=EGAHIinitgraph(&graphdriver&graphmode \\tc)int graphdriver=DETECTint graphmodeintgraph(&graphdriver&graphmode "\\tc") 11.2

  • 2detectgraphvoid far detectgraph(int far *graphdriverint far * graphmode)3cleardevice void far cleardevice(void)4closegraphvoid far closegraph(void) 11.2

  • void far restorecrtmode(void)5restorecrtmode6setgraphmode void far setgraphmode(void) 11.2

  • 21 putpixelvoid far putpixel(int xint yint color) linevoid far line(int startxint startyint endxint endy) : 11.2

  • 2 drawpolyvoid far drawpoly(int numpointsint far *points) rectanglevoid far rectangle(int left int top int right int bottom) barvoid far bar(int leftint topint rightint bottom) 11.2

  • bar3void far bar3d(int leftint topint rightint bottomint depthint topflag) 11.2

  • 3 circlevoid far circle(int xint yint radius) arcvoid far arc(int xint yint startint endint radius) pieslicevoid far pieslice(int xint yint startint endint radius) ellipsevoid far ellipse(int xint yint startint endint xradiusint yradius) 11.2

  • Turbo Cx090180270360x. 11.2

  • 3 initgraphgraphmode 11.2

  • 16

    11.2

  • 1setcolorvoid far setcolor(int color) 2setbkcolorvoid far setbkcolor(int color)3setfillstylevoid far setfillstyle(int patternint color)4floodfillvoid far floodfill(int xint yint bordercolor), 11.2

  • 4 viewport 0000

    (00)

    (400150)(200100)(20050) 11.2

  • 1setviewportvoid far setviewport(int x1int y1int x2int y2int clipflag)2clearviewportvoid far clearviewport(void), 11.2

  • 51outtextvoid far outtext(char *str)2outtextxy3settextstylevoid far outtextxy(int xint ychar *str)void far settextstyle(int fontint directionint charsize) 11.2

  • 11.2

  • 13.3 . DOS1. DOS 2. DOS CPUINT nn3. Turbo Cint86ROM-BIOS 11.3

  • . 1int86int int86(int intnouinon REGS * inregsuinon REGS * outregs)BIOS 11.3

  • INT 10H 11.3

  • 21intdosint intdos(union REGS *inregsunion REGS *outregs)2intdosxint intdosx(union REGS *inregsunion REGS *outregsstruct SREGS *segregs) segregsSREGSSREGSdos.hstructSREGS{unsigned intes; /**/unsigned intds; /**/unsigned intss; /**/unsigned intcs; /**/} 11.3

  • 3DOSsystemint system(char *cmd). 12device=mouse.sys/1 /*1COM1*/34. INT 33H 11.3

  • 11.4 13.4 C. 123

  • . DOSDOS1DOSUCDOSDOS2CC3TC4DOS 11.4

  • . DOS DOS101 11.4

  • 1putpixel12312linetovoid far setlinestyle(int linestyleunsigned upattemint thickness) 11.4