iT邦幫忙

2021 iThome 鐵人賽

DAY 2
0
自我挑戰組

Enhancement the c programming in 30 days系列 第 2

Day 2 - A short introduction to gcc usage - 1

  • 分享至 

  • xImage
  •  

In this part, I will compile a simple program called hello_world.c, and describe the compiler how handle it.

The code example as below

#include <studio.h>

int main(){

    printf("Hello World !\n");
    
    return 0;
}

Now, we must use gcc compile the example above.

In your terminal, you can type

$ gcc -o "output_fileName" "program_name" 

then you will see the output file with a name appear in your directory.

To run your output file,

$ ./"output_fileName" 

that './' means a current working directory. Afterward, you will see the result is print the "Hello World !" on your screen.

continue...


上一篇
Day 1 - Series Overview
下一篇
Day 3 - A short introduction to gcc usage - 2
系列文
Enhancement the c programming in 30 days3
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言