#include <stdio.h> #include <conio.h> main() { int i; textbackground(0); clrscr(); for(i=1; i<8; i++) { window(10+i*5, 5+i, 30+i*5, 15+i); textbackground(i); clrscr(); } getch(); } 为什么在vc6.0里运行后会出现f:\dfdsaf.cpp(6) : error C2065: 'textbackground' : undeclared identifierf:\dfdsaf.cpp(7) : error C2065: 'clrscr' : undeclared identifierf:\dfdsaf.cpp(10) : error C2065: 'window' : undeclared identifier的错误(请详细解答!谢谢)

热心网友

这几个函数都是TC里面才有的。虽然VC可以用来编译C程序,但是不同的编译器除了标准C的函数库外,还有专用的函数库。textbackground是TC专有的函数,VC里面没有,所以在连接的时候出现上述错误。也就是说,你这个程序使用了标准C以外的函数,不是在所有的编译器下都可以正确编译连接的。