Fork me on GitHub

在mac console下 执行c++文件

$ g++ -o NewFileName OldFileName.cpp

-o is the letter O not zero

NewFileName will be your executable file

OldFileName.cpp is your c++ file

After you run that command type the following in terminal to run your program:

$ ./NewFileName

2  同1一样效果

$ g++ OldFileName.cpp -o NewFileName 

3

posted on 2016-03-21 11:46  pengyingh  阅读(417)  评论(0编辑  收藏  举报

导航