涡轮增压 C++默认使用C语言?

发布于 2024-12-28 05:59:25 字数 551 浏览 4 评论 0原文

我最近从学校计算机上安装了 Turbo C++ 3.0 编译器,用于编写 C 和 C++ 程序,但它似乎无法识别 C++ 代码。

例如,如果我添加 #include 它会说找不到 iostream 库,我无法使用 cout 等表达式。 (我应该 还提到我尝试过#include“iostream”

这在逻辑上意味着它给我任何 C++ 相关函数的错误。

我还尝试导入其他特定的 C++ 库,例如 但它不起作用。

在 Turbo C++ 中编写 C 代码就像一个魅力,我已经编写了几个程序,其中没有任何错误,但是只有当我尝试编写 C++ 代码时才会出现问题。

Turbo C++ 3.0 中是否有针对 C++ 的“开启”功能?老实说,编译器相当令人困惑,我查看了设置,但没有发现什么特别有用的东西。

如果这不是一个合适的问题,我也很抱歉,但我不知道在哪里问,而且我非常绝望。

I've recently gotten Turbo C++ 3.0 compiler from my school computer, for making both C and C++ programs, however it doesn't seem to recognize C++ code.

For example if I add #include <iostream> it's saying it can't find
iostream library and I can't use expressions such as cout. (I should
also mention I tried #include "iostream")

This logically means it's giving me errors for any C++ related function.

I've also tried to import other specific C++ libraries such as <string.h> but it's not working.

Writing C code in Turbo C++ works like a charm, I've written several programs with no error whatsoever in them however the problems only come up when I try to code C++.

Is there a "Turn-on" for C++ in Turbo C++ 3.0? The compiler is rather confusing to be honest, and I've looked in the settings but found nothing particularly helpful.

Also I'm sorry if this isn't an appropriate question but I don't know where to ask it and I'm running pretty desperate.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

稀香 2025-01-04 05:59:25

Turbo C++ 3.0 于 1991 年发布,远早于 C++ 语言标准化。直到 1998 年,这种情况才发生。编写符合标准的代码时会遇到很多麻烦。我认为它有 iostreams 的实现,但头文件名为 iostream.h。期望它只是顺便类似于标准流类。

这不值得你花时间。当合规实现可以免费获得时就不会了。

Turbo C++ 3.0 was released in 1991, long before the C++ language was standardized. That didn't happen until 1998. You'll have plenty of trouble writing standard compliant code. I think it had an implementation of iostreams but the header file was named iostream.h. Expect it to resemble the standard stream classes only in passing.

This is not worth your time. Not when compliant implementations are freely available.

是你 2025-01-04 05:59:25

我认为,您没有为标准 C++ 实验室设置正确的包含目录。应使用 Options -> 打开此选项目录,据我记得

如果您刚刚从学校计算机复制编译器,您可能会忘记复制标准库文件。

C 不需要这样的文件,所以它工作得很好。

另外,请考虑使用现代编译器

I think, you do not set correct include directory for standard c++ labrary. This option should be turned with Options -> Directories, as I can remember

If you just copied compiler from your school computer, you may forget to copy standard library files.

C does not require such files, so, it works fine.

Also, please, consider using modern compiler

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文