码迷,mamicode.com
首页 > 编程语言 > 详细

xCode 编写C++程序

时间:2018-12-16 13:22:03      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:完成   world   http   html   logs   line   return   工程   ret   

步骤可参考:
https://www.cnblogs.com/weixuqin/p/6440252.html


创建工程时,可注意:
1、所以选择macOS下的Command Line Tool
对于xCode来说, C程序类被归类到Mac下的命令行工具里面。

2、语言选择 C++
创建完成后,工程中就会出现 main.cpp 文件。
如果不选择 C++,默认是 main.m 文件。

文件内容是:


int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}

点击command + R,即可运行。
控制台将会出现:Hello, World!

xCode 编写C++程序

标签:完成   world   http   html   logs   line   return   工程   ret   

原文地址:http://blog.51cto.com/14129329/2331026

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!