关于一个system函数的应用问题
#include <stdio.h>#include <stdlib.h>
#include <dos.h>
#include <conio.h>
int key();
upbar(int y);
downbar(int y);
#define KEY_DOWN 80
#define KEY_DOWN 80
#define KEY_UP 72
#define KEY_A 30
#define KEY_B 48
#define KEY_C 46
#define KEY_Q 18
#define KEY_ENTER 28
void main ()
{
int y;
int ky;
char ch;
textmode(C80);
textbackground(13);
textcolor(RED);
window(7,8,19,15);
textbackground(1);
textcolor(RED);
window(8,9,18,14);
gotoxy (3,3);
cprintf("Q:quit\r\n");
gotoxy (3,4);
cprintf("A:dir\p\r\n");
gotoxy (3,5);
cprintf("C:dir\p\r\n");
do
{ky=key();
switch(ky)
{
case KEY_A:
{y=12;
ky=KEY_ENTER; };
break;
case KEY_B:
{ky=KEY_ENTER;
y=13;};
break;
case KEY_C:
{y=14;
ky=KEY_ENTER;};
break;
case KEY_Q:
{y=11;
ky=KEY_ENTER;};
break;
case KEY_DOWN:
if(y<13)
{downbar(y);
y++;};
break;
case KEY_UP:
if(y>10)
{upbar(y);
y--;};
break;}
}while(ky!=KEY_ENTER);
switch(y)
{
case 11:
ch='%';
break;
case 12:
{system("dir");
getch();};
break;
case 13:
{system("dir/p");
getch();};break;
case 14:
{system("dir/w");
getch();};break;
}}
int key()
{
union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;}
upbar(int y)
{
int i;
typedef struct text1_struct
{
unsigned char ch;
unsigned char attr;}text1;
text1 t;
for(i=9;i<=17;i++)
{
gettext(i,y,i,y,&t);
t.attr=0x1f;
puttext(i,y,i,y,&t);
gettext(i,y+1,i,y+1,&t);
t.attr=0x4f;
puttext(i,y+1,i,y+1,&t);}
gotoxy(3,y+1);
return;}
downbar(int y)
{
int i;
typedef struct text1_struct
{
unsigned char ch;
unsigned char attr;}text1;
text1 t;
for(i=9;i<=17;i++)
{
gettext(i,y,i,y,&t);
t.attr=0x1f;
puttext(i,y,i,y,&t);
gettext(i,y-1,i,y-1,&t);
t.attr=0x4f;
puttext(i,y-1,i,y-1,&t);}
gotoxy(3,y+1);
return;}
其中的switch(y)
{
case 11:
ch='%';
break;
case 12:
{system("dir");
getch();};
break;
case 13:
{system("dir/p");
getch();};break;
case 14:
{system("dir/w");
getch();};break;
}}
的system函数为什么这样用的呢,