
demo.cpp
// 引入標準程式庫中相關的輸入、輸出程式
#include <iostream>
// 引入標準程式庫中相關的字串程式
#include <string>
// std 為標準程式庫的命名空間
using namespace std;
int main(void) {
// 下面建立名稱為 m , string 型態的物件
// 小括弧為 string 的建構子
// 雙引號為字串字面常數
string m("There is no spoon.");
// cout 用來輸出的物件
// endl 為新行符號 '\n'
cout << endl;
cout << m << endl;
cout << endl << endl;
return 0;
}
/* 檔名: demo.cpp
作者: Kaiching Chang
時間: 2014-5 */the end
沒有留言:
張貼留言