在ubuntu中编译c++程序

Compiling c++ program in ubuntu

本文关键字:c++ 程序 编译 ubuntu      更新时间:2023-10-16

编译C++程序时出现问题

错误:iostream.h没有这样的文件或目录

我曾经打过招呼,其中hello.cpp是我的文件名。

使用

#include<iostream>

名称iostream.h已弃用。

使用#include <iostream>而不是#include <iostream.h>

如果你想知道iostream.h为什么过时,我建议你阅读:为什么#include过时的

#include<iostream>
using namespace std;

这是我写的第一个代码