C++

How to Calculate Any Day of the Week?

Author : Walter Date : September 27, 2014 Firday MyBlog : http://learningpen.blogspot.com/ Tool : Dev C++ Language : C++ Function : Calculate any day of the week? #include #include // for floor() #include // for getch() #include // for exit() #include // for system() using std::cout; using std::cin; //======================= void Menu( void ); int main( void ) { Menu(); return 0; }// End of main

Password Security Version 2.0

Password.cpp Author : oursharingciub Date : September 26, 2014 Firday Email : [email protected] Tool : Dev C++ Language : C++ Notice: Reference Mr. Jake Rodriguez Pomperada programming #include #include #include #include //system(), Sleep( ) #include using namespace std; const int PASSLEN= 7 ; //The length of password string PassGet( void ); // Get the password void Menu( void ); //The start

How to Use Operators Overloading with Arrays in C++

We want to implement array class with the following specifications: - range checking. - array assignment. - arrays that know their size. - compare arrays using '==' and '!=' operators. In the next example we will implement a simple class for integers is called Array, it has the previous specifications, and it has the following structure:
  1. class Array {
  2. friend ostream

Object-Oriented Programming In C++: Friend Function

Friend Function:

Is a function that: 1. is not a member of a class. 2. has access to the class's private and protected members. 3. is considered as a normal external function that is given special access privileges. 4. is not in the class's scope. 5. is not called using the member-selection operators (. and –>) unless they are members of another class. 6. is declared by the class that is granting access. We can define a friend function anywhere in the class declaration.

Object-Oriented Programming In C++: Objects Composition

In real-life, complex objects are often built from smaller, simpler objects. You are built from smaller parts: a head, a body, some legs, arms, etc ... This process of building complex objects from simpler ones is called object composition. Composition is used for objects that have/has a relationship to each other. A house has a door, has a roof, has a balcony. C++ allows us to do object composition in a very simple way by using classes as member variables in other classes.

Object-Oriented Programming In C++: Destructor

Contents:

1. Destructor.

2. When Constructors and Destructors are Called.

Destructor

Is a member function in the class, which has the following characteristics: 1. It has the same name as the class preceded with a tilde '~'. For example, the destructor for class Time is declared: ~Time() 2. It doesn't return any type. 3. It is called when objects are destroyed to release all allocated resources. 4.

Object-Oriented Programming in C++: Constructors

Contents:

1. Constructors. 2. Default Constructors. 3. Constructors with Arguments. 4. Time Class with Constructors.

Constructors:

Constructor is a member function in the class, which has the following characteristics: 1. It has the same name as the class. 2. It doesn't return any type. 3. It is called every time an instance of a class is created. 3.