C++ 语言程序设计

Click here to load reader

download C++ 语言程序设计

of 23

description

C++ 语言程序设计. 王雪晶 [email protected]. 教材. 《C++ 程序设计 》. 谭浩强 . 清华大学出版社 . 2004. 参考书. 《C++ Primer Plus》.Stephen Prata. 人民邮电出版社 .2002 年 . 《C++ 程序设计语言 ( 特别版 )》. 美(斯特朗斯特鲁普)著 . 裘宗燕译 . 机械工业出版社 .2002 年 . 《C++Primer_3rd》. 潘爱民,张丽译 . 中国电力出版社. 教学安排. 理论课:星期二 5 、 6 节 (3-11 周 ) 上机: 4-12 周 - PowerPoint PPT Presentation

Transcript of C++ 语言程序设计

  • [email protected]

  • C++.. . 2004.

  • C++ Primer Plus.Stephen Prata..2002.C++ ()....2002.C++Primer_3rd...

  • 56(3-11)4-1212785613

  • 1 C++8 9 10 11 12 13

  • 1 C++ 1.1 CC++ 1.2 C++ 1.3 C++ 1.4 C++ 1.5 C++

  • 1.1 CC++1954FORTRAN1964BASIC1972CD.M.Ritchie2080 C++AT&T Bell()Bjarne StroustrupC

  • 1.1 CC++C++1.0 1988C++2.0 1989C++3.0 1991C++4.0 ANSI C++ 1997

  • C++C(1) C(2)

  • ;double sqrt(double arg){ // code for calculating a square root}void f(){ double root2 = sqrt(2); //}

  • 1.2 C++1.1 This is a C++ program. #include //iostreamusing namespace std; //stdint main( ){cout
  • 1.2 ab

    #include //using namespace std; //stdint main( ) //{ // int a,b,sum; // cin>>a>>b; // sum=a+b; // cout

  • 1.3 xy#include //using namespace std;int max(int x,int y) //max{ int z; if(x>y) z=x; //ifx>yxz else z=y; //yz return z; //zmax} //maxint main( ) //{ int a,b,m; // cin>>a>>b; // m= max(a,b); cout
  • 1.4 C++#include // using namespace std;class Student // Student{private: // int num; // numint score; // scorepublic: // void setdata( ) // setdata{cin>>num; // numcin>>score; // score}

  • void display( ) // display {cout
  • 1001 98.5 (1)1002 76.5 (2)

    num=1001 (1)score=98.5 (1)num=1002 (2)score=76.5 (2)

  • 1.3 C++C++ () :

  • 1.3 C++: C++main(class)C++C++

  • 1.11.4 C++

  • 1.5 C++Visual C++ 6.0 Visual C++.NETGCC