linux使用g++
发布日期:2025-04-08 10:58:18 浏览次数:10 分类:精选文章

本文共 320 字,大约阅读时间需要 1 分钟。

安装gedit并编写并运行C++代码的步骤说明

安装gedit

在 Ubuntu 或 Debian 系统中安装 gedit 可以通过以下命令实现:

sudo apt-get install gedit

启动gedit

使用下列命令启动 gedit 并创建新文件:

gedit hello.cpp

编写代码

在 gedit 中输入以下代码:

#include

using namespace std;int main() {cout << "Hello world !";return 0;}

保存文件

编译代码

在当前工作目录下编译代码:

g++ -o hello hello.cpp

运行程序

执行生成的可执行文件:

./hello

完成

上一篇:linux使用tar解压出现 gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not 的解决方法
下一篇:linux作业整理

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2025年04月27日 13时44分43秒