gpt4 book ai didi

c++ - 在 visual studio 中编码错误而不是 turbo C++ - C

转载 作者:太空宇宙 更新时间:2023-11-04 02:54:28 37 4
gpt4 key购买 nike

我已经在 turbo C++ 编译器中编写了代码,现在我已经转向 visual studio express 2012 for windows desktop我收到很多错误,这些错误在 Turbo C++ 中没有出现错误是

1   IntelliSense: identifier "textcolor" is undefined   c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c  75  1   Project2
2 IntelliSense: identifier "RED" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 75 11 Project2
3 IntelliSense: identifier "textbackground" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 76 1 Project2
4 IntelliSense: identifier "BLACK" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 76 16 Project2
5 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 77 1 Project2
6 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 83 2 Project2
7 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 118 4 Project2
8 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 121 3 Project2
9 IntelliSense: identifier "WHITE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 126 12 Project2
10 IntelliSense: identifier "BLUE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 127 17 Project2
11 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 209 3 Project2
12 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 211 3 Project2
13 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 214 2 Project2
14 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 249 3 Project2
15 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 264 3 Project2
16 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 288 1 Project2
17 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 313 5 Project2
18 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 314 5 Project2
19 IntelliSense: identifier "RED" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 314 15 Project2
20 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 316 5 Project2
21 IntelliSense: identifier "WHITE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 317 15 Project2
22 IntelliSense: identifier "BLACK" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 320 15 Project2
23 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 327 5 Project2
24 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 328 5 Project2
25 IntelliSense: identifier "WHITE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 348 15 Project2
26 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 365 3 Project2
27 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 367 3 Project2
28 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 371 2 Project2
29 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 390 5 Project2
30 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 442 5 Project2
31 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 491 3 Project2
32 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 492 3 Project2
33 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 498 2 Project2
34 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 508 4 Project2
35 IntelliSense: identifier "GREEN" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 510 14 Project2
36 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 514 5 Project2
37 IntelliSense: identifier "WHITE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 526 14 Project2
38 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 540 5 Project2
39 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 566 5 Project2
40 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 595 1 Project2
41 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 600 1 Project2
42 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 624 3 Project2
43 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 627 5 Project2
44 IntelliSense: incomplete type is not allowed c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 711 17 Project2
45 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 727 3 Project2
46 IntelliSense: identifier "getdate" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 732 5 Project2
47 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 734 2 Project2
48 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 735 5 Project2
49 IntelliSense: incomplete type is not allowed c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 740 40 Project2
50 IntelliSense: incomplete type is not allowed c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 740 49 Project2
51 IntelliSense: incomplete type is not allowed c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 740 58 Project2
52 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1030 2 Project2
53 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1087 4 Project2
54 IntelliSense: identifier "sleep" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1089 4 Project2
55 IntelliSense: identifier "clrscr" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1092 2 Project2
56 IntelliSense: identifier "textcolor" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1104 5 Project2
57 IntelliSense: identifier "gotoxy" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1105 5 Project2
58 IntelliSense: identifier "WHITE" is undefined c:\Users\Windows 8 Java\Documents\Visual Studio 2012\Projects\Project2\Project2\main.c 1139 17 Project2

我发现它不允许我使用 clrscr、sleep、textcolor、textbackground、gotoxy,它甚至不理解颜色名称所有这些都曾经在 Turbo C++ 中工作我想不出在 visual studio 中执行此操作的方法。也许我缺少一些设置,因为即使创建一个 c 项目我也必须做很多事情,我根据这个创建了一个 c 项目:http://www.youtube.com/watch?v=bjHD1N7tjV4然后粘贴我的代码

最佳答案

Visual Studio 不支持 borland 函数 clrscr(),gotoxy() 等..

你需要一个特殊的库

例子---> Public Domain Curses(PDCurses)

否则你需要找一些替代品

一些例子

clrscr() ==> system("cls")

您可以使用 Windows Console Functions 定义您自己的函数

gotoxy() 的示例定义

void gotoxy(int x, int y)
{
COORD pos = { x, y };

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}

关于c++ - 在 visual studio 中编码错误而不是 turbo C++ - C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19107947/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com