注册 登录
编程论坛 C图形专区

文本的输出问题....请教高手..

黑夜陨落 发布于 2008-11-28 22:40, 1152 次点击
我用VC编译C程序的出现了下列错误..

--------------------Configuration: 22 - Win32 Debug--------------------
Compiling...
22.c
D:\1\22\22.c(15) : error C2065: 'C80' : undeclared identifier
D:\1\22\22.c(16) : error C2065: 'BLUE' : undeclared identifier
D:\1\22\22.c(17) : error C2065: 'RED' : undeclared identifier
D:\1\22\22.c(35) : error C2001: newline in constant
D:\1\22\22.c(36) : error C2146: syntax error : missing ')' before identifier 'movetext'

我的movtext()函数有")"编译的时候为什么说missing?

另..为什么程序所使用的库函数在VC中必须要先定义?不然编译的时候会出现undefine的警告?
5 回复
#2
黑夜陨落2008-11-28 22:41
附上程序..

#include<conio.h>
#include<stdio.h>
textmode();
textbackground();
textcolor();
clrscr();
gotoxy();
window();
gettext();
puttext();
movetext();
void main(void)
{
 char ch[4*8*2];
 textmode(C80);
 textbackground(BLUE);
 textcolor(RED);
 clrscr();
 gotoxy(10,10);
 cprintf("L:load");
 gotoxy(10,11);
 cprintf("S:save");
 gotoxy(10,12);
 cprintf("D:delete");
 gotoxy(10,13);
 cprintf("E:exit");
 cprintf("press any key to continue");
 getch();
 gettext(10,10,18,13,ch);
 clrscr();
 textbackground(1);
 textcolor(3);
 window(20,9,34,14);
 clrscr();
 cprintf("1\r\n2\r\n3\r\n4\r\n);
 movetext(20,9,34,14,40,10);
 puts("hit any key");
 getch();
 clrscr();
 cprintf("press any key to put text");
 getch();
 clrscr();
 puttext(20,10,31,13,ch);
 getch();

}
#3
黑夜陨落2008-11-28 23:04
D:\1\22\22.c(15) : error C2065: 'C80' : undeclared identifier
D:\1\22\22.c(16) : error C2065: 'BLUE' : undeclared identifier
D:\1\22\22.c(17) : error C2065: 'RED' : undeclared identifier

还有这三个问题没有解决..

在TC中编译是没有问题的....请在VC中要怎么改才行?

希望朋友们帮忙解决一下...谢谢.
#4
似水如风2008-11-29 12:46
在VC中估计要重写。VC的图形函数库与TC不同。
1