关闭

gcc programming in mac

110人阅读 评论(0) 收藏 举报
分类:

step 1: subl helloworld.c


#helloworld.c

#include "stdio.h"
int main(int argc, char const *argv[])
{
    printf("%s\n", "helloworld");
    return 0;
}

step 2: in iterm2

gcc [-o helloworld.out] helloworld.c

finally: execute the executable outfile.

./helloworld.out

if you want to check the running-time, use time before the command.

time ./helloworld.out

NOTICE:
header file is not created by windows, it` s not WINDOWS API.
so, in linux, stdio.h is also need.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:57933次
    • 积分:1186
    • 等级:
    • 排名:千里之外
    • 原创:61篇
    • 转载:7篇
    • 译文:0篇
    • 评论:9条
    文章分类
    最新评论