在mac console下 执行c++文件

Posted pengyingh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在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

以上是关于在mac console下 执行c++文件的主要内容,如果未能解决你的问题,请参考以下文章