Computer Programming - strona 8

note /search

Operators as methods

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 420

Operators as methods  object of the class is the first argument of the operator  we declare all arguments, but the first one  declaring int point::operator...

Operators vs Methods

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 427

Operators vs Methods  different syntax for declaring, defining an calling  no default arguments allowed (exception: function call operator)  there is a fixed number of arguments for specific operator (exception: function call operator)  there is a traditional semantics (meaning) of operators ...

Paradigm of the object oriented programming

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 266

Paradigm of the object oriented programming object oriented programming — a programming paradigm using "objects" - data structures consisting of data fields and methods together with their interactions A problem is seen as a set of objects and as a relations among objects. ...

What is Data Abstraction

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 364

What is Data Abstraction  Strong division between the interface and the implementation helps to reuse and share the code  Modification of the implementation does not require modifications of the rest of the program (if the interface remains the same) ...

What is OOP

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 497

What is OOP  OOP means Object Oriented Programming  Promotes strong associations between data and methods of manipulating data  Inheritance - relationships between objects - children inherit properties of their ancesors, may add and change ...

A default pointer value

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 385

A default pointer value  … use a space between * and =  Correct: - void f(char* ="Abc"); - void g(int * = NULL); - void g(int* =NULL);  Wrong: - void f(char*="Abc"); - void g(int *= NULL); - void g(int*=NULL); ...

Convention for ++ and --

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 378

Convention for ++ and --  operator++() and operator--() are prefix ones ++i --i  postfix operators should be defined using one additional unnamed int argument: operator++(int); operator--(int); i++ i-- ...

Enum

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 427

Enum enum numbers {ZERO, ONE, FIVE=5, SIX};  ” numbers” is an optional name of a new type  conversion from enum to int is automatic ...

Index operator

  • Politechnika Śląska
  • Computer Programming
Pobrań: 0
Wyświetleń: 623

Index operator result T::operator[](index);  Any type of result and index allowed, common sense implies integer index  We may use objects as if they were arrays ...