全文预览

C语言基础教程下载

上传者:火锅鸡 |  格式:pdf  |  页数:92 |  大小:8076KB

文档介绍
rflowturnedonandgetanexecutablefilewhichwill\roperatecorrectly.\r*/\r#include<stdio.h>\r#include<dos.h>\r#include<conio.h>\r/*Theclocktickinterrupt*/\r#defineINTROXIC\rvoidinterrupt(*oldhandler)(void);\rintcount=0;\rvoidinterrupthandler(void)\r(\r/*\rdisableinterruptsduringthehandlingoftheinterrupt\r*/\rdisable();\r/*increasetheglobalcounter*/EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rcount++;\rreenableinterruptsattheendofthehandler\r*/\renable();\r/*calltheoldroutine*/\roldhandler();\r)\rinimain(void)\r(\r/*savetheoldinterruptvector*/\roldhandler=getvect(INTR);\r/*installthenewinterrupthandler*/\rsetvect(INTR,handler);\r/*loopuntilthecounterexceeds20*/\rwhile(count<20)\rprintf("countis%d\n'\count);\r/*resettheoldinterrupthandler*/\rsetvect(INTR,oldhandler);\rreturn0;\r)

收藏

分享

举报
下载此文档