參考文獻(xiàn)
1.C++Primer(第三版) Stanley B.Lippman, Josee Lajoie (中國(guó)電力出版社)
2.C++語(yǔ)言程序設(shè)計(jì)(第二版) 鄭莉 董淵 (清華大學(xué)出版社)
3.C++Primer Plus Stephen Prata (人民郵電出版社)
4.C語(yǔ)言程序設(shè)計(jì) 譚浩強(qiáng) 清華大學(xué)出版社
C++是從C語(yǔ)言演變過來的,完全可以脫離C而從新學(xué)習(xí)C++
#include<iostream.h>
void main()
{
cout<<"welcome to C++ world !!"<<endl;
}
知識(shí)點(diǎn)1: *.h 文件被稱為頭文件.(標(biāo)準(zhǔn)的C++頭文件沒有后綴) 如iostream.h
2.*.C 習(xí)慣稱之為C程序文本文件.(在UNIX系統(tǒng)下則稱之為C++文件) C++程序文件的后綴在不同產(chǎn)品中則不同 如 *.CPP *.CXX...類似的頭文件在C++的不同實(shí)現(xiàn)中也不相同.
3.#include 預(yù)處理器指示符
4.#include<> 和#include " " 區(qū)別
#include<>是標(biāo)準(zhǔn)或者工程文件. #include" " 表示當(dāng)前目錄下尋找.
#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