几个简单的问题
#include "Conio.h "
#define A clrscr
int main(void)
{int i;
char *f[]={ "sdf ", "sdfd ", "d ", "a ", "b ", "c ", "ee ", "gf ", "fe "};
char buf[9*4*2]; 这是一个数组吧?
textbackground(BLUE); |为什么把这2行删去会有错误呢?
A(); |
gettext(10,2,24,11,buf);
window(10,2,24,11);
textbackground(YELLOW);
textcolor(0);
A(); 把这个删掉没有字符的矩形地方怎么没了?
for(i=0;i <9;i++)
{gotoxy(1,i++);
cprintf( "%s ",f[i]);
}
getch();
movetext(10,2,24,11,40,10);
puttext(10,2,24,11,buf);
getch();
}
[解决办法]
#include "Conio.h "
#include <stdio.h>
#define A clrscr
int main(void)
{int i;
char *f[]={ "sdf ", "sdfd ", "d ", "a ", "b ", "c ", "ee ", "gf ", "fe "};
char buf[9*4*2]; /*这是一个数组吧?*/ /* 对,是一个数组 */
/*textbackground(BLUE); |为什么把这2行删去会有错误呢?
A(); |*/ /* 删出这两行程序不会出错,照样运行 */
gettext(10,2,24,11,buf);
window(10,2,24,11);
textbackground(YELLOW);
textcolor(0);
A(); /* 把这个删掉没有字符的矩形地方怎么没了? */ /* clrscr()表示屏幕清空,在这就是将上面定义的黄色区域的颜色清除了 */
for(i=0;i <9;i++)
{gotoxy(1,i++);
cprintf( "%s ",f[i]);
}
getch();
movetext(10,2,24,11,40,10);
puttext(10,2,24,11,buf);
getch();
}
[解决办法]
代码没贴全,鉴定完毕