C++课件2chapter4-5
合集下载
C语言英文课件2:数据类型
perimeter and the area */
}
Result: r =1.500000 l = 9.42, s= 7.07
4. DECLARATION AND INITIALIZATION
(1) DECLARATION form:
< data type> < variable name >[,< variable name2>……];
•Data is the object be processed by algorithm
•Data types in C:
integer 1.Basic Types
real(float) character enum array 2. Tectonic Types structure union 3. Pointer 4.NULL
(1) VARIABLE NAME:keep to rules for identifier
(2) MEMORY UNIT
(3) VALUE
Nonce value
In a program,we can quote variable by variable names
p
variable name
3
location
2. Sort
CONSTANTS
symbolic CONSTANTS
can be differentiated by writing format
2.3.2 VARIABLES
1. Concept
Its value can be changed during program
executing
2. Three elements of variables
C语言程序设计教程第2版课件第4章
一条完整的C语句必须以“;”结束。 “;”是 一个语句不可缺少的一部分。
1. 控制语句:完成一定的控制功能。
C 有9种控制语句:
⑴if( ) ~ else ~
(条件语句)
⑵ for( ) ~
(循环语句)
⑶ while( ) ~
(循环语句)
⑷ do ~ while( ) (循环语句)
⑸ continue
4.1 C语句介绍
一、C程序结构
C程序
源程序文件1
源程序文件2 • • • • • • 源程序文件n
预处理命令 全局变量声明 函数1 • • • • • •
函数n
函数首部 函数体
局部变量声明 执行语句
二、C语句概述
C语句分类: 1.控制语句 2.函数调用语句 3.赋值语句 4.空语句 5.复合语句
main() { int x,y;
scanf(“%5d,%3d”,&x,&y); } 输入数据: 345,567
说明:
1. %后的“*”附加说明符,用来表示跳过它相应的数据。 如:scanf(“%2d ,%*3d , %2d”,&a,&b); 输入:12 , 456 , 67 结果:a=12 b=67
如:float f=123.456;
printf(“%10.2f ,%-10.2f”,f);
输出结果:
123.46,123.46
8. e格式——以指数形式输出实数。
(1) %e 如: printf(“%e”,123.456);
输出结果: 1.234560e+002
6位
3位
一般共占13列宽度
(2) % m.ne和 %–m.ne: m、n和“–”字符含义 与
1. 控制语句:完成一定的控制功能。
C 有9种控制语句:
⑴if( ) ~ else ~
(条件语句)
⑵ for( ) ~
(循环语句)
⑶ while( ) ~
(循环语句)
⑷ do ~ while( ) (循环语句)
⑸ continue
4.1 C语句介绍
一、C程序结构
C程序
源程序文件1
源程序文件2 • • • • • • 源程序文件n
预处理命令 全局变量声明 函数1 • • • • • •
函数n
函数首部 函数体
局部变量声明 执行语句
二、C语句概述
C语句分类: 1.控制语句 2.函数调用语句 3.赋值语句 4.空语句 5.复合语句
main() { int x,y;
scanf(“%5d,%3d”,&x,&y); } 输入数据: 345,567
说明:
1. %后的“*”附加说明符,用来表示跳过它相应的数据。 如:scanf(“%2d ,%*3d , %2d”,&a,&b); 输入:12 , 456 , 67 结果:a=12 b=67
如:float f=123.456;
printf(“%10.2f ,%-10.2f”,f);
输出结果:
123.46,123.46
8. e格式——以指数形式输出实数。
(1) %e 如: printf(“%e”,123.456);
输出结果: 1.234560e+002
6位
3位
一般共占13列宽度
(2) % m.ne和 %–m.ne: m、n和“–”字符含义 与
Chapter05_数组和广义表_数据结构(C语言版)_严蔚敏_配套ppt课件
M
1 1 2 3 3 4
1 5 3 1 2 4
3 7 -1 -1 -2 2
N
1 1 2 3 4 5
1 3 3 2 4 1
3 -1 -2 -1 2 7
行列下 标调换
1 5 3 1 2 4
1 1 2 3 3 4
3 7 -1 -1 -2 2
按行下 标排序
法1:
按照矩阵M的列序进行转置,即按三元组A的 第二个字段值(列下标)由小到大的顺序进行转置。 为了找到M中每一列中所有的非零元素,需要对其 三元组表a.data从第一行起整个扫描一遍,由于 a.data是以M的行序为主序来存放每个非零元素 的,对于M中具有相同列下标的非零元来讲,先扫 描到的非零元的行下标一定小于后扫描到的非零元 的行下标,由此得到的恰是b.data应有的顺序。
• 压缩的含义
– 为多个值相同的元素只分配一个存贮空间; – 零元素不分配或少分配存贮空间。
• 特殊矩阵:元素值相同或零元素分布有 一定规律的矩阵。 • 稀疏矩阵:元素值相同或零元素分布没 有规律的矩阵。 • 特殊矩阵的压缩存贮实际是将二维数组 的数据元素压缩到一维数组上。
特殊矩阵的压缩存储
特殊矩阵: 非零元在矩阵中的分布有一定规则
常用的稀疏矩阵的存储方法
三元组表示法 顺序存储 行逻辑联接的顺序表 带辅助行向量的二元组表示法 伪地址表示法 带行指针向量的单链表示法 链接存储 散列存储 行列表示法(十字链表) 多链表示法(正交表)
顺序存储
1、三元组表示法 用一个线性表来表示稀疏矩阵,线性表的每个 结点对应稀疏矩阵的一个非零元素。其中包括三个 域,分别为该元素的行下标、列下标和值。结点间 的先后顺序按矩阵的行优先顺序排列(跳过零元 素),将线性表用顺序的方法存储在连续的存储区 里。
香港朗文版4A-Chapter4-Five-hundred-years-agoPPT课件
-
3
What did people wear five hundred years ago?
Silk clothes
Cotton clothes
-
4
Ship
How did people travel?
Vehicles(工具)
boat
-
5
horse
Carriage
-
6
sedan chair
-
7
cook with
gas?
32
-
They cooked with
firewood.
How did
they cook?
33
-
Most people ate congee and vegetables.
Some people ate rice and meat.
What did
they eat?
34
congee and vegetables
22 rice and meat -
Were there any tunnels 500 years ago?
a tunnel
a rope bridge
23
-
Were there any long bridges
500 years ago?
long bridge
28
-
词尾-ed 的发音 ask-asked
call-called
bake-baked
clean-cleaned
cook-cooked
jog-jogged
drop-dropped
listen-listened
finish-finished
财务专业英语ppt课件
E1-2 Divide into groups as instructed by your professor and discuss the following:
a. How does the description of accounting as the "language of business" relate to accounting as being useful for investors and creditors?
a. Information used to determine which products to produce. b. Information about economic resources, claims to those resources,
and changes in both resources and claims. c. Information that is useful in assessing the amount, timing, and
•Definition of Accounting: business language information system basis for decisions
•Types of Accounting Information: (1)Financial Accounting: •Internal users
篮球比赛是根据运动队在规定的比赛 时间里 得分多 少来决 定胜负 的,因 此,篮 球比赛 的计时 计分系 统是一 种得分 类型的 系统
Contents
Chapter One
Chapter Two
Chapter Three Chapter Four
a. How does the description of accounting as the "language of business" relate to accounting as being useful for investors and creditors?
a. Information used to determine which products to produce. b. Information about economic resources, claims to those resources,
and changes in both resources and claims. c. Information that is useful in assessing the amount, timing, and
•Definition of Accounting: business language information system basis for decisions
•Types of Accounting Information: (1)Financial Accounting: •Internal users
篮球比赛是根据运动队在规定的比赛 时间里 得分多 少来决 定胜负 的,因 此,篮 球比赛 的计时 计分系 统是一 种得分 类型的 系统
Contents
Chapter One
Chapter Two
Chapter Three Chapter Four
C C 程序设计 第2版 教学课件 ppt 电子教案 C第5章PPT-2
例5-16 动态数组用法示例
//数组长度可根据输入元素个数动态变化 //由初始长度n开始,每当长度不足时就追加长度增量d
#include <stdio.h> #include <malloc.h> #define d 10 //空间追加增量 void main( ) { int x,*p,*a; unsigned n,m=0,i; printf("请输入数组的初始长度n="); scanf("%d",&n); a=p=(int *)calloc(n,sizeof(int)); //产生初始长度的动态数组 printf("请输入数组元素值,0表示输入结束:\n"); scanf("%d",&x); //读入第一个元素值
3.realloc(p,size)函数的用法
重新分配函数 p:原来分配空间的首地址 size:现在要求的空间长度 含义:将原来用动态分配函数所分配的存储空间 修改为长度为size的动态存储空间
加大或缩小空间 用calloc或malloc所分配的空间不够用(或嫌过长)时 调用realloc进行重新分配,长度改为size 重新分配的存储空间首地址可能与原地址不同 系统会自动将数据移到新分配的存储空间 真正实现动态数组(长度动态变化)
例5-17 new和delete的用法示意性程序
delete[ ] a; //回收a所占空间 b=new int[n/2]; //产生长度为n/2的整型动态数组b for(i=0;i<n/2;i++)*(a+i)=10*i+1; //填写b的元素值 for(p=b,i=0;i<n/2;i++)printf("%4d",*p++); //输出数组b printf("\n"); delete[ ] b; //回收b所占空间 }
第4章第5章ppt课件
2020/12/29
16
4. 三个表达式可以有,也可以全无,但“;”不 能少。如果表达式2无,程序将进入无限循环。
5. 可以用break命令中断循环. 例: 计算s=1+3+5+……+n直到最后一项为99止.
#include <iostream.h> main() {int i, s=0; for (i=1; ;i=i+2)
8
2020/12/29
程序2: #include <iostream.h> main() { int i=1, s; for (s=0; i<101; i++) s+=i; cout<<"sum="<< s<<endl; }
2020/12/29
9
程序3: #include <iostream.h> main() {int i=1, s=0; for (; i<101;) s+=i++; cout<<"sum="<< s<<endl; }
{ if (i%2==0) continue;
s=s+i;
}
cout<<"s="<<s<<endl;
}
2020/12/29
18
4.2 多层循环 例:开设3门课程,计算每个学生平均成绩
#include <iostream.h> main() {int i,j,s=0;
int a[5][3]={87,78,79,87,98,67,56,79,98}; for (i=0;i<3;i++)
C语言程序设计教程(第2版)第5章PPT课件
f= w*0.313; else f= w*0.205; printf(“w=%f,f=%f\n’,w,f);
}
5.3.2 条件运算符
1.条件运算符与条件表达式
条件表达式的一般形式: 表达式1 ? 表达式2∶表达式3 如: (a>b) ? a : b
如:max= (a>b) ? a : b ; 若 a=3, b=2, 则 max=?
if 语句说明:
⑴ if后面的表达式一般为逻辑表达式或关系表 达式,也可以是任意数值类型表达式。
该语句是合法的:if(3) ⑵ if 语pri句ntf中(“的o“k!”语)句; ”为一个简单语句或复合语句。
如:下面程序段是否有错?
if (x>=0) popsirtiinvtef.(”“)X; is
与其它运算符优先级的比较:
! 算术运算符 关系运算符 && 和 || 赋值运算符
(高) 例如:c=d>a+b&&a>b
等效于: c=((d>(a+b))&&(a>b))
(低)
5.2.2 逻辑表达式
1. 什么是逻辑表达式?
用逻辑运算符将逻辑运算对象连结起来的式子。
如:(a>b)&&(b<c) 、!a||a>b
本章要点关系运算符与关系表达式逻辑运算符与逻辑表达式条件运算符与条件表达式if语句switch语句本章难点if语句的嵌套switch语句的使用51关系运算符和关系表达式小于小于或等于大于大于或等于等于
第5章 选择结构
本章要点 ➢关系运算符与关系表达式 ➢逻辑运算符与逻辑表达式 ➢条件运算符与条件表达式 ➢if语句 ➢switch语句 本章难点 ➢if语句的嵌套 ➢switch语句的使用
}
5.3.2 条件运算符
1.条件运算符与条件表达式
条件表达式的一般形式: 表达式1 ? 表达式2∶表达式3 如: (a>b) ? a : b
如:max= (a>b) ? a : b ; 若 a=3, b=2, 则 max=?
if 语句说明:
⑴ if后面的表达式一般为逻辑表达式或关系表 达式,也可以是任意数值类型表达式。
该语句是合法的:if(3) ⑵ if 语pri句ntf中(“的o“k!”语)句; ”为一个简单语句或复合语句。
如:下面程序段是否有错?
if (x>=0) popsirtiinvtef.(”“)X; is
与其它运算符优先级的比较:
! 算术运算符 关系运算符 && 和 || 赋值运算符
(高) 例如:c=d>a+b&&a>b
等效于: c=((d>(a+b))&&(a>b))
(低)
5.2.2 逻辑表达式
1. 什么是逻辑表达式?
用逻辑运算符将逻辑运算对象连结起来的式子。
如:(a>b)&&(b<c) 、!a||a>b
本章要点关系运算符与关系表达式逻辑运算符与逻辑表达式条件运算符与条件表达式if语句switch语句本章难点if语句的嵌套switch语句的使用51关系运算符和关系表达式小于小于或等于大于大于或等于等于
第5章 选择结构
本章要点 ➢关系运算符与关系表达式 ➢逻辑运算符与逻辑表达式 ➢条件运算符与条件表达式 ➢if语句 ➢switch语句 本章难点 ➢if语句的嵌套 ➢switch语句的使用
C语言课件(4,5)
第 四章
三 编译预处理
模块化程序设计
编译预处理是在编译前对源程序进行的一些 加工。 预处理是由编译系统中的预处理程序按源程 序中的预处理命令进行的。 C语言的预处理命令均以“#‖打头,末尾不 加分号,以区别于C语句。 编译预处理命令可以出现在程序中的任何位 置,其作用域是自出现点到所在的源程序的 末尾。
main( ) { int x=1; { void prt(void); int x = 3; prt( ); printf(―2nd x = %d\n‖,x); } printf(―1st x = %d\n‖,x); } void prt (void) { int x = 5 ; printf(―3th x = %d\n‖,x) }
第 四章
模块化程序设计
7. 函数的嵌套调用及递归调用 •嵌套调用:在一个函数中又调用另外一个 函数。 函数不允许嵌套定义,但可以嵌套调用!
main 函数 { u=f1(i,t); } 1 7 f1 函数 { 2
c=f2(b-1,b+1);
f2 函数 3 5 4
返回f2函数值
} 6
第 四章
模块化程序设计
模块化程序设计
main( ) { void increment (void); increment( ); increment( ); increment( ); } void increment (void) { static int x=0; /*static*/ x + +; printf(“ %d\n”, x); }
第 四章
1 宏替换
模块化程序设计
宏替换是预处理命令#define指定的预处理。 ① 字符串替换 在程序中可以用#define命令定义字符串宏替 换:
2A Chapter 5 Signs we see 课件(新思维小学英语)
Rewrite the sentences with don’t or can’t.
1
You can’t pick the flowers. _D_o_n_’t_p_ic_k_t_h_e_f_lo_w_e_r_s.____
2
Don’t feed the ducks.
_Y_o_u _c_an_’t__fe_e_d_t_h_e_d_u_c_ks_. __
Don’t feed the ducks.
Don’t walk on the grass.
Signs (Things we must not do)
climb the trees. Don’t feed the ducks.
walk on the grass.
You can’t
climb the trees. feed the ducks. walk on the grass.
Can you guess what the sign says?
Why can’t we feed the animals?
The animals may eat too much and be sick!
Why are the children feeding the
monkeys?
Are the children following the rules?
Rewrite the sentences with don’t or can’t.
3
You can’t walk on the grass.
_D_o_n_’t_w_a_l_k_o_n_t_h_e_g_r_a_ss_.__
4
Don’t climb the trees.
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Chapter 4: data abstraction
Contents
Object-Oriented Programming(OOP); The syntax of C++; Class and Object; The important features of C++: e.g.. Function Overloading,Constants, inheritance,Polymorphism and virtual function;
class Clock { public: void SetTime(int NewH, int NewM, int NewS); void ShowTime( ); private: int Hour,Minute,Second; };
20102010-5-22
13
Encapsulation
Definition: Combining the data member and code member abstracted from entity together as a whole Goal: Reinforce security and predigest(简化) programming. The user needn’t know the realization detail. Using the members of the class with special accessing (利用具有特殊访问类的成员 ) Purview by using the outer interface of the class(通过使用类的外部接口访问职
20102010-5-22
11
Abstraction Example—Clock
Data abstraction:
int Hour, int Minute, int Second
Code abstraction:
SetTime( ), ShowTime( ).
20102010-5-22
12
Abstraction Example—Clock
20102010-5-22 17
Namespaces in headers
You’ll notice that using directives are present in nearly all the cpp files in this book, usually in the form: using namespace std; Since std is the namespace that surrounds the entire Standard C++ library, this particular using directive allows the names in the Standard C++ library to be used without qualification. In short: don’t put using directives(使用 指令)in header files.
20102010-5-22
4
Object-oriented programming
Features:
Object : Data and data manipulation encapsulation;(封装是一种信息隐藏技术,即对象内部对用户是隐藏的,不可直接访问;用户只能见到对 象封装界面上的信息,通过对象的外部接口访问对象。封装的目的在于将对象的使用者和对象的设计者分开, 使用者无须知道对象内部实现的细节,只需要知道对象接收的消息即可。当用户向对象发送消息后,对象将根 据收到的消息来调用内部方法以做出响应。 Class: type; Interface : relation;(是用来描述关系用的,不能实现功能。接口只能做功能定义,但不能实现它。 Communication: message;(消息未必一定要通过函数传递,也可以通过公共的属性来传递消息。当然这要尽量 避免,不过编译器会放行不会做这种限制。)
20102010-5-22
6
Object-oriented programming
Object
entity. Property method Object structure object name -attribute +Operation()
20102010-5-22
7
Object-oriented programming
20102010-5-22
2
Goals
To understand the concepts of object-oriented programming; To master the syntax of c++language programming; To master the principle & method of c++; To read, write, program and debug c++program
20102010-5-22
10
Abstract data typing
Abstract is course of generalizing the actual object, getting the common characters of this object and describing the characters
General the actual object; Data abstract:attribute or state to the object Code abstract:To describe the mutual behavior character or function of a particular object Realization of abstract:using declaration of class
权范围内的消息) .
Realization of encapsulation: The “{ }” in the class
20102010-5-22
14
Header file
In C++ the use of header files becomes crystal clear(非 常明显). They are virtually mandatory (强制)for easy program development, and you put very specific information(特殊的) in them: declarations. The header file tells the compiler what is available in your library.
20102010-5-22
16
The preprocessor directives
The preprocessor directive #define can be used to create compile-time flags. You have two choices: you can simply tell the preprocessor that the flag is defined, without specifying a value: #define FLAG you can give it a value (which is the typical C way to define a constant): #define PI 3.14159 In either case, the label can now be tested by the preprocessor to see if it has been defined:
一遍重复的定义同一个功能。如果没有变化的功能,继承就好。但 是现在对继承过度使用的情况也需要注意,能用“使用”能力达到 的就不要通过“继承”能力达到。 因为这样可以做松耦合而不是继承的紧耦合。对大型系统构造尤其重 要。 所谓多态,即一个名词可具有多种语义。 可以通过Function Overloading, virtual function实现,重载是指同一函数名以及运算符 可以具有不同含义的多种实现版本,编译器将根据函数调用的参数形 式决定调用哪一种实现版本。
dat a
20102010-5-22
encapsulation
5
Merit: Simple and independence(简单就是接口要尽可能简单明了,不要把不
相干的东西往里面塞,独立就是保持接口的独立性,不要彼此做不需要的关联。)
Reuse:inheritance and polymorphism(就是说你不需要一遍
20102010-5-22
3
From C To C++
In order to compensate the insufficiency, Bjarne Stroustrup Bell Lab started to improve and to expand C, in 1980. At first it was called " C with class ", in 1983 named C++ officially, after 3 revision, has formulated ANSI C++ standard draft in 1994. Later time C++ still continuously development.
20102010-5-22
8
The basic object
Step one is exactly that. C++ functions can be placed inside structs as “member functions.” struct Stash { int size; // Size of each space int quantity; // Number of storage spaces int next; // Next empty space unsigned char* storage; // Functions! void initialize(int size); void cleanup(); int add(const void* element); void* fetch(int index); int count(); void inflate(int increase); }; ///:~
Contents
Object-Oriented Programming(OOP); The syntax of C++; Class and Object; The important features of C++: e.g.. Function Overloading,Constants, inheritance,Polymorphism and virtual function;
class Clock { public: void SetTime(int NewH, int NewM, int NewS); void ShowTime( ); private: int Hour,Minute,Second; };
20102010-5-22
13
Encapsulation
Definition: Combining the data member and code member abstracted from entity together as a whole Goal: Reinforce security and predigest(简化) programming. The user needn’t know the realization detail. Using the members of the class with special accessing (利用具有特殊访问类的成员 ) Purview by using the outer interface of the class(通过使用类的外部接口访问职
20102010-5-22
11
Abstraction Example—Clock
Data abstraction:
int Hour, int Minute, int Second
Code abstraction:
SetTime( ), ShowTime( ).
20102010-5-22
12
Abstraction Example—Clock
20102010-5-22 17
Namespaces in headers
You’ll notice that using directives are present in nearly all the cpp files in this book, usually in the form: using namespace std; Since std is the namespace that surrounds the entire Standard C++ library, this particular using directive allows the names in the Standard C++ library to be used without qualification. In short: don’t put using directives(使用 指令)in header files.
20102010-5-22
4
Object-oriented programming
Features:
Object : Data and data manipulation encapsulation;(封装是一种信息隐藏技术,即对象内部对用户是隐藏的,不可直接访问;用户只能见到对 象封装界面上的信息,通过对象的外部接口访问对象。封装的目的在于将对象的使用者和对象的设计者分开, 使用者无须知道对象内部实现的细节,只需要知道对象接收的消息即可。当用户向对象发送消息后,对象将根 据收到的消息来调用内部方法以做出响应。 Class: type; Interface : relation;(是用来描述关系用的,不能实现功能。接口只能做功能定义,但不能实现它。 Communication: message;(消息未必一定要通过函数传递,也可以通过公共的属性来传递消息。当然这要尽量 避免,不过编译器会放行不会做这种限制。)
20102010-5-22
6
Object-oriented programming
Object
entity. Property method Object structure object name -attribute +Operation()
20102010-5-22
7
Object-oriented programming
20102010-5-22
2
Goals
To understand the concepts of object-oriented programming; To master the syntax of c++language programming; To master the principle & method of c++; To read, write, program and debug c++program
20102010-5-22
10
Abstract data typing
Abstract is course of generalizing the actual object, getting the common characters of this object and describing the characters
General the actual object; Data abstract:attribute or state to the object Code abstract:To describe the mutual behavior character or function of a particular object Realization of abstract:using declaration of class
权范围内的消息) .
Realization of encapsulation: The “{ }” in the class
20102010-5-22
14
Header file
In C++ the use of header files becomes crystal clear(非 常明显). They are virtually mandatory (强制)for easy program development, and you put very specific information(特殊的) in them: declarations. The header file tells the compiler what is available in your library.
20102010-5-22
16
The preprocessor directives
The preprocessor directive #define can be used to create compile-time flags. You have two choices: you can simply tell the preprocessor that the flag is defined, without specifying a value: #define FLAG you can give it a value (which is the typical C way to define a constant): #define PI 3.14159 In either case, the label can now be tested by the preprocessor to see if it has been defined:
一遍重复的定义同一个功能。如果没有变化的功能,继承就好。但 是现在对继承过度使用的情况也需要注意,能用“使用”能力达到 的就不要通过“继承”能力达到。 因为这样可以做松耦合而不是继承的紧耦合。对大型系统构造尤其重 要。 所谓多态,即一个名词可具有多种语义。 可以通过Function Overloading, virtual function实现,重载是指同一函数名以及运算符 可以具有不同含义的多种实现版本,编译器将根据函数调用的参数形 式决定调用哪一种实现版本。
dat a
20102010-5-22
encapsulation
5
Merit: Simple and independence(简单就是接口要尽可能简单明了,不要把不
相干的东西往里面塞,独立就是保持接口的独立性,不要彼此做不需要的关联。)
Reuse:inheritance and polymorphism(就是说你不需要一遍
20102010-5-22
3
From C To C++
In order to compensate the insufficiency, Bjarne Stroustrup Bell Lab started to improve and to expand C, in 1980. At first it was called " C with class ", in 1983 named C++ officially, after 3 revision, has formulated ANSI C++ standard draft in 1994. Later time C++ still continuously development.
20102010-5-22
8
The basic object
Step one is exactly that. C++ functions can be placed inside structs as “member functions.” struct Stash { int size; // Size of each space int quantity; // Number of storage spaces int next; // Next empty space unsigned char* storage; // Functions! void initialize(int size); void cleanup(); int add(const void* element); void* fetch(int index); int count(); void inflate(int increase); }; ///:~