C++入门

作者: 测试菜鸟 | 来源:发表于2018-12-31 11:24 被阅读0次

一. 安装编译器

linux下执行查看是否安装GNU编译器GCC

$ g++ -v

没有安装的话运行下面两个命令安装

yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake

yum -y install wget httpd-tools vim

二. 编写并执行代码

#include <iostream>using namespace std;

int main(){

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

 return 0;

}

$ g++ helloworld.cpp -o helloworld

$ ./helloworld

相关文章

网友评论

      本文标题:C++入门

      本文链接:https://www.haomeiwen.com/subject/wkyilqtx.html