Скачать презентацию
Идет загрузка презентации. Пожалуйста, подождите
Презентация была опубликована 9 лет назад пользователемСтепан Чалеев
1 1/13 Chapter 06- Implementing Operators in a class
2 2/13 Objectives Definitions How to implement operators which will act on objects
3 3/ Definitions Conventional definitions Operator: Symbol that represent an operation which returns a value. Operand: Data that will be acted on by an operator. Result: New datum will be created after the operation executed. Types of operators: Unary operators ++, -- Binary operators + - * && & Ternary operators?: Overriding an opertor: Re-defining the operation of an operator
4 4/ Borland C++ operators C++ supports overriding functions and operators also. Operators cannot be overriden:..* :: ?: # ##
5 5/ Syntax of opertor implementation
6 6/ Unary,Binary operator Demo
7 7/ Operator [] Demo [ ] operator can accept only one parameter
8 8/ Operator ( ) Demo
9 9/13 Operator ( ) Demo …
10 10/ Operator with string parameter
11 11/13 Operator with string parameter…
12 12/13 Summary Syntax for implementing operator in a class DataType operator Symbol (Parameters) { }
13 13/13 THANKS
Еще похожие презентации в нашем архиве:
© 2024 MyShared Inc.
All rights reserved.