參考文獻
1.C++Primer(第三版) Stanley B.Lippman, Josee Lajoie (中國電力出版社)
2.C++語言程序設計(第二版) 鄭莉 董淵 (清華大學出版社)
3.C++Primer Plus Stephen Prata (人民郵電出版社)
4.C語言程序設計 譚浩強 清華大學出版社
C++是從C語言演變過來的,完全可以脫離C而從新學習C++
#include<iostream.h>
void main()
{
cout<<"welcome to C++ world !!"<<endl;
}
知識點1: *.h 文件被稱為頭文件.(標準的C++頭文件沒有后綴) 如iostream.h
2.*.C 習慣稱之為C程序文本文件.(在UNIX系統下則稱之為C++文件) C++程序文件的后綴在不同產品中則不同 如 *.CPP *.CXX...類似的頭文件在C++的不同實現中也不相同.
3.#include 預處理器指示符
4.#include<> 和#include " " 區別
#include<>是標準或者工程文件. #include" " 表示當前目錄下尋找.
#ifdef bookstore
#define bookstore
#endif
檢查bookstore是否在前面被定義了..
#include<iostream.h>
v1(int x,int y)
{ cout<<"V1"<<endl;
cout<<"{"<<endl;
cout<<"x= "<<x<<endl;
cout<<"y= "<<y<<endl;
cout<<"}"<<endl;
}
v2(int x,int y)
{ cout<<"V2"<<endl;
cout<<"{"<<endl;
cout<<"x= "<<x<<endl;
cout<<"y= "<<y<<endl;
cout<<"}"<<endl;
}
void main()
{ int bug;
#ifdef bug
cout<<"welcome to our C++ world!!"<<endl;
v1(2,5);
v2(3,5);
#endif