linux编译c++

linux编译并运行c++

如果是编译运行c语言,则是gcc

1
2
$ g++ helloworld.cpp
$ ./a.out

当前目录产生一个a.out可执行文件


指定可执行文件名:

1
2
$ g++ helloworld.cpp -o helloworld
$ ./helloworld
Donate? comment?