博客
关于我
linux使用g++
阅读量:794 次
发布时间:2023-02-03

本文共 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

完成

转载地址:http://avzfk.baihongyu.com/

你可能感兴趣的文章
Linux下配置Mysql允许远程访问
查看>>
Linux下配置无密码登录
查看>>
Linux下,C++判断指定路径下,是否存在wps打开的文件
查看>>
Linux下,Docker出现Cannot connect to the Docker daemon. Is the docker daemon running on this host错误解决办法
查看>>
Linux下,配置nodejs环境两种方法,并使用cron系统任务定时启动web服务
查看>>
Linux专家揭秘:Keepalived的安装和VIP自动漂移 - 简单步骤,大功效!
查看>>
Linux中 dir 命令还能这样玩!
查看>>
Linux中.a,.la,.o,.so文件的意义和编程实现
查看>>
linux中6个被低估但很有用的命令
查看>>
Linux中Docker的使用
查看>>
linux中ElasticSearch的安装 安装ES&Kibana 配置IK分词器(环境搭建)
查看>>
Linux中ftp连接530错误的解决方法
查看>>
Linux中install命令你有用过吗?用途很大!
查看>>
Linux中rpm命令用法
查看>>
Linux中systemctl命令骨灰级详解
查看>>
Linux中telnet命令
查看>>
Linux中yum和apt-get用法及区别
查看>>
linux中~和/的区别
查看>>
linux中下载和安装git2.3.0
查看>>
linux中出现不在 sudoers 文件中。此事将被报告的解决方法
查看>>