visual c++開新專案預設如下,(圖1):

Visual c++ 

增加標頭檔後…(圖2):
Visual c++ 

Example Source Code:

// yy.cpp : 定義主控台應用程式的進入點。

#include “stdafx.h” //不可刪除
#include 〈iostream〉

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

cout<<"TEST";

system("Pause");

return 0;
}

/*
========================
由圖可見…
主要是增加
標頭檔:#include 〈iostream〉 加入標頭檔是為了使用cout、cin…
命名空間:using namespace std;
輸出:cout 如未加入標頭檔cout、cin…是不能使用
輸入:cin

至於
int _tmain(int argc, _TCHAR* argv[]) 開專案預設的
亦可
int main(int argc, char* argv[])
或
int main( )
以上均可。
*/


arrow
arrow
    全站熱搜

    mitblog 發表在 痞客邦 留言(0) 人氣()