Download
1 / 48

面向对象程序设计 - PowerPoint PPT Presentation


  • 174 Views
  • Uploaded on
  • Presentation posted in: General

面向对象程序设计. 山东师范大学信息科学与工程 刘弘. 第一章 C++ 语言概述. 1.1 面向对象程序设计基本概念 1.2 C++ 语言是一种面向对象的程序设计语言 1.3 C++ 程序结构的特点 1.4 Visual C++ 6.0 简介. 1.1 面向对象程序设计基本概念. C++ 发展史

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha

Download Presentation

面向对象程序设计

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript



C++

1.1

1.2 C++

1.3 C++

1.4 Visual C++ 6.0


1.1

  • C++

    C++CCC1969~1973UNIXCBBKen ThompsonBCPLUNIXBCPLMartin Richards60MIT


C++

1971Dennis RitchieBNBNew BBBRitchieC1983CANSI1989CANSI CBjarne StroustrupCC++UNIXC++CC++ISO19971119988


  • FORTRAN

  • ALGOL

  • SIMULA 67

  • ADA

  • SMALLTALK


  • 2060Simula 67Algol 60

  • 2070AdaAda


  • SmalltalkSimula


Smalltalk


C++CC++


C++C++


intdouble





Cclass""


ABAB1MyBicycle2changeSpeed3HigherSpeed


()

12



()


()

""""


1.2 C++

C++VCC++C++


C++

1C++C++CCC++C++


2C++

C++(Private)(Public)(Protected)


3C++

C++


4C++

()C++


5C++

C++C++


6C++

C++


7C++

C++


C++C

1. C++C

2. C++C

3. C++C


C++C

  • C++C1C/*Explanation Sentence*/C//Explanation Sentence"//"


2

CC++CC++for(int i = 1; i < = 100; i++);


3

C++CCC++fint f(char, double);C"f( )"


4

  • "+/"C++CC++


5

C++newdeleteCmalloc()free();


6/

CC//cout<<"C++ is beautiful!";aint a;cin>>a;/"<<>>"/


C++

1C++C++(a-zA-Z)(0-9)(#%^&*_<>?\,)


2

  • C++6

  • C++


#include <iostream.h>

void main()

{ double x,y;

cout<<"Enter two float numbers:";

cin>>x>>y;

double z=x+y;

cout<<"x+y="<<z<<endl;

}


C++

  • C++1C++#include <iostream.h>2C++

    cout<<Enter two float numbers:

    cin>>x>>y;

    cout<<x+y=<<z<<endl;


3C++C++main()4C++


5

65C++C++

#define PI 3.14159


C++

C++(\)


C++

C++C++C++C++()


C++

Visual C++6C++PCC++


C++.cppSource Code.objObjective CodeExecutable Code.exe.exe


  • Visual C++ 6.0,

    File->New>File->C++ Source File

  • C++

  • Build->Compile ****.cpp

  • Build->Execute ***.exe(Ctrl-F5,


  • .C++*.cpp.

    2.

    File->New>Project->Win32 Console Application

    3.

    Project->Add File to Project->Insert File into Project

    4.Build->Build All

    5.


#include <iostream.h>

int add(int,int);

void main()

{ int a,b;

a=5;

b=7;

int c=add(a,b);

cout<<"a+b="<<c<<endl;

}

int add(int x,int y)

{

return x+y;

}


ad
  • Login