c++[ch1] hello world
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!";
return 0;
}

#include <iostream>
包含了input/output等等的header file(ex:cin,cout)
using namespace std:
tells the compiler to use the std (standard) namespace,使得std內定義的所有識別符號都有效(std::cout -> cout)
int main()
程式進入點,程式從此開始
cout << "Hello world!";
將”Hello world!”輸出於螢幕上(cout 類似於 print)
return 0;
程式執行到return時將會結束並且回傳(int)0的值
Filed under: c++ - @ 2021 年 7 月 1 日 下午 4:47
標籤: c++