Puedes seguirnos en

BUSCADOR

Engineering

Object Oriented Programming – Clases and Object

In C++, the class forms the basis for Object oriented programming. The class is used to define the nature of an object.

Classes are created using the keyword class. A class declaration defines new type that links data and code.This new type is then used to create objects of that particular class.
Thus class is a logical abstraction, but an object has physical existence.
A class declaration is similar to a structure declaration syntactically.

Syntax of class

class class-name{
 access specifier:
     data members and member functions;
 access specifier:
     data members and member functions;
 }Object-list;

The object list is optional. If present, that would be declared as object of that class.
Access specifiers can be:

  1. Private
  2. Public
  3. Protected

By default, the access specifier is set to private. So if no access specifier is declared it would automatically assign private to it.

Anuncio publicitario
Escrito por

Administrador de ENGGDRCAOS. Canal dedicado especialmente a la formación del estudiante que aspira a ser ingeniero. Todos los videos son Ingles. Apasionado del universo Apple, estudiante de Ingeniería y Gamer por vocación.

Publicidad

ARTÍCULOS RELACIONADOS

Engineering

Function prototyping is one of the key improvements added to the C++ functions. When a function call is encountered, the compiler checks the function...

Engineering

Destructors is used to destroy the objects that have been created by a constructor. The destructor is member function whose name is the same...

Engineering

Inheritance is not just simply about creating various derived classes trough a base class. There are some other benefits of using Inheritance in Object...

Engineering

When virtual functions are created for implementing late binding, there are some basic rules that satisfy the compiler requirements: The virtual function must be...