用Xcode创建第一个C++程序——helloWorld
打开Xcode,在主界面上选择Create a new Xcode project, Choose a template for you new project 选择 macOS ,Application 选择 Command Line Tool ,然后点击next;

输入Product Name "helloWorld" , Language 选择 C++ 选项即可,点击next;

选择左侧栏的main.cpp , 即为创建C++文件,".cpp" 是C++的标准扩展名;Xcode默认提供了hello world 程序,点击左上角 Run 按钮,控制台输出即会输出 "Hello,World!"。

这样,即成功用Xcode创建第一个C++程序。
网友评论