Skip to Content

session 1

linuxawy's picture

this is a draft writtin inside the class while it's running

Why C++

Object Oriented Concepts

in object oriented we don't think about procedures, we think about objects that interact together, we don't try to explore all paths that the logic may run through

Instance vs type


  • abstraction/hiding made easier
  • Object behaviour modification: more goes here
  • Generic programming
    • type independance : more goes here
  • Inter-object interaction
    • design: more goes here

note about over architecting of a program.


  • an object naming: compiler handles it, it doesn't have to be a pointer. It's abstracting you from dealing with memory.
  • Declaration: in compiler messages it's called Lvalue
int& ref=x;

you can't say it's ok to say but it's not useful to use it.


  • Overloading:

you can overload the function as the function signature is different, you can redefine the function

  • function signature

includes the passed variables, and their types

differs from so when you call a function it depends on your passed variable to call which function. but you can always cast.

  • Default arguments:

only the last n arguments, not in the middle.. not that you already took to function signature, one takes int & chat, and one taking only int for example)


  • namespace can be nested
  namespace y
       int fun()


  • it's the central concept in C++
  • Class as object type

Dr. Radut | book