gpt4 book ai didi

c++ - 为什么在新的 IDE 中必须使用命名空间标准,而用 Turbo C++/Borland C++ 编写的程序不需要命名空间标准?

转载 作者:太空宇宙 更新时间:2023-11-03 10:22:43 26 4
gpt4 key购买 nike

<分区>

为什么在新的编译器中必须使用 namespace std 而用 Turbo C++/Borland C++ 编写的程序不需要 namespace std ?

这适用于旧的编译器

#include <iostream.h>

int main () {
cout << "Hello Programmers";

return 0;
}

但是我们必须在新的编译器中编写下面给定的程序而不是上面的程序,因为上面的程序在新的编译器中不起作用。

#include <iostream>
using namespace std;

int main () {
cout << "Hello Programmers";

return 0;
}

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