c语言textmode问题

Python014

c语言textmode问题,第1张

conio.h不属于ISO C,只能用于Visual C++、Borland C++、Turbo C 2.0、Turbo C++ 3.0、MinGW的gcc 等微软平台的编译器。而且,这几个编译器中,只有Borland和Turbo系列的编译器在<conio.h>中支持textmode等函数

函数名: textmode

功 能: 将屏幕设置成文本模式

用 法: void textmode(int mode)

#include

int main(void)

{

textmode(BW40)

cprintf("ABC")

getch()

textmode(C40)

cprintf("ABC")

getch()

textmode(BW80)

cprintf("ABC")

getch()

textmode(C80)

cprintf("ABC")

getch()

textmode(MONO)

cprintf("ABC")

getch()

return 0

}

1 Dint n=10int a[n+2]标准C不允许用变量定义数组的元素个数

2 C40 VC6.0中,int占四个字节,int a[10]共10个元素,占4*10=40个字节