海阔天空

海阔凭鱼跃 天高任鸟飞

 

C++简介

C++是在C的基础上,增加面向对象的概念而来。
C++是C的超集,它包括C的全部属性和特征,并且添加了对面向对象的完全支持。

结构化程序设计
结构化程序设计把程序看作是一个处理数据的流程,按照业务逻辑对数据进行一系列的操作,然后得到想要得结果。
结构化设计的思想是功能分解和逐步求精。把一个复杂的任务分解成一系列较小的易于理解的功能部件。

面向对象程序设计
面向对象程序设计的特点:封装,继承和多态。


结构化程序设计的一般流程:
比如需要实现某个功能,该功能主要有3个主要的处理逻辑。
编码基本步骤如下:
1)
//to so some work
int main()
{
    //step 1
    //first todo some thing 

    //step 2
    //then todo some thing 

    //step 3
    //todo some thing at last
}

2)
明确步骤的函数名称和接口
//to so some work
int main()
{
    //step 1
    //first todo some thing 
    //int workstep1(int nDataResource)

    //step 2
    //then todo some thing 
    //int workstep2(some data from step1 or others)

    //step 3
    //todo some thing at last
    //int workstep3(some data)
}

3)
实现函数体,并调试功能

posted on 2007-07-03 00:33  liuym  阅读(1054)  评论(0编辑  收藏  举报

导航