Ubuntu18.04系统结构如何安装c 环境
资讯 2025-03-02 16:22 143

Ubuntu18.04体系如何安装c 环境

C 是C语言的继承,它是一种使用非常广阔的数据计算机编码语言。那么在ubuntu18.04体系中如何安装c 环境呢?本文给出周密说明。

1.首先升级使用软件列表

sudo apt-get update

2.安装gcc和g

sudo apt-get install gcc

sudo apt-get install g

3.编写验证脚本

vi hello.cpp

写入以下内容

#include

using namespace std;

int main()

{

cout << "Hello, world!" << endl;

return 0;

}

保存退出

4.编译脚本

g hello.cpp -o hello

生成了名为hello的可实施材料

5.运行材料,验证安装完成

./hello