1/13 Chapter 06- Implementing Operators in a class.

Презентация:



Advertisements
Похожие презентации
1/30 Chapter 8: Dynamic Binding And Abstract classes.
Advertisements

1/27 Chapter 9: Template Functions And Template Classes.
Operator Overloading Customised behaviour of operators Chapter: 08 Lecture: 26 & 27 Date:
Operators and Arithmetic Operations. Operators An operator is a symbol that instructs the code to perform some operations or actions on one or more operands.
Secrets Of The Cinema How Can You Make Your Own Film?
HPC Pipelining Parallelism is achieved by starting to execute one instruction before the previous one is finished. The simplest kind overlaps the execution.
Data Types in C. A Data Type A data type is –A set of values AND –A set of operations on those values A data type is used to –Identify the type of a variable.
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chap 1-1 Chapter 1 Why Study Statistics? Statistics for Business and Economics.
© Luxoft Training 2013 Annotations. © Luxoft Training 2013 Java reflection / RTTI // given the name of a class, get a "Class" object that // has all info.
S5-1 PAT328, Section 5, September 2004 Copyright 2004 MSC.Software Corporation SECTION 5 RESULTS TITLE EDITOR.
1 - 1 Accounting role as element of a control system of any organization Soniev Jamoliddin.
2005 Pearson Education, Inc. All rights reserved. 1 Object-Oriented Programming: Polymorphism.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Configuring Groups and Policies Building an Agent Kit.
Loader Design Options Linkage Editors Dynamic Linking Bootstrap Loaders.
Inner Classes. 2 Simple Uses of Inner Classes Inner classes are classes defined within other classes The class that includes the inner class is called.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Route Selection Using Policy Controls Applying Route-Maps as BGP Filters.
2005 Pearson Education, Inc. All rights reserved. 1 Object-Oriented Programming: Interface.
Gradient In simple terms, the variation in space of any quantity can be represented (eg graphically) by a slope. The gradient represents the steepness.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Optimizing BGP Scalability Limiting the Number of Prefixes Received from a BGP Neighbor.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Using CSA Analysis Generating Behavior Analysis Reports.
Транксрипт:

1/13 Chapter 06- Implementing Operators in a class

2/13 Objectives Definitions How to implement operators which will act on objects

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/ Borland C++ operators C++ supports overriding functions and operators also. Operators cannot be overriden:..* :: ?: # ##

5/ Syntax of opertor implementation

6/ Unary,Binary operator Demo

7/ Operator [] Demo [ ] operator can accept only one parameter

8/ Operator ( ) Demo

9/13 Operator ( ) Demo …

10/ Operator with string parameter

11/13 Operator with string parameter…

12/13 Summary Syntax for implementing operator in a class DataType operator Symbol (Parameters) { }

13/13 THANKS