C++

Static Data Members in C++

Submitted by moazkhan on

Static Data Members

In this tutorial you will learn: 1. What are Static Data Members? 2. Why to use Static Data Members? 3. How to use Static Data Members in program? 4. Basic C++ syntax What are Static Data Members? Static members are those data members that retain their value , whenever the static member is reused in the program. Static data members store the latest value in them so that the value will be used for next time when the function that makes use of static data member is called.

Returning Objects from Function in C++

Submitted by moazkhan on
Returning Objects from Function in C++ In this tutorial you will learn: 1. How to pass an object in a function argument 2. How to return an object from a function 3. How to write functions outside class 4. Basic C++ syntax In C++ when we need to return a variable from a function we have to write its return type before the name of function and arguments.

Constructors and Destructors in C++

Submitted by moazkhan on

Constructors and Destructors in C++

In this tutorial you will learn: 1. What are Constructors? 2. What are Destructors? 3. To use constructors and destructor in programs 4. Basic C++ syntax What are constructors? Whenever an object of a certain class is made, the data member of the objects are be initialized to some value and this purpose is achieved by using special function called constructors.

Setter and Getter functions in C++

Submitted by moazkhan on

Setter and Getter functions in C++

In this part you will learn: 1. How to make an object of class in C++ 2. What are Setters 3. What are getters 4. To use setters and getters 5. Basic C++ syntax How to make an object of class in C++? Whenever we want to make an object of the class we first define its class and then in the main of the program we write name of the class followed by the name of the object we want to make. e.g to make an object we write the code as class anyclass{ //data members and functions }; int main { anyclass myobj; } In the above code we have

Introduction to Object Oriented Programming in C++

Submitted by moazkhan on

Introduction to Object Oriented Programming in C++

In this part you will learn: 1. Why using Object Oriented programming approach? 2. What are Classes 3. Why we use classes 4. What are Access specifiers 5. Basic C++ syntax Why we use Object Oriented programming approach? We use object oriented programming in C++ because the procedural language( language containing all the functions and variables within the main of the program) cannot cope with very large projects like when we have to use several hundred of functions within one program.

Object Oriented Programming in C++

Submitted by moazam60 on
In this set of tutorial we will learn object oriented programming in c++ . Object Oriented programming helps you develop softwares using a new approach. In this book you will learn the core concepts of object Oriented programming i.e inheritance , polymorphism and composition. We will learn what are these techniques and how to use these techniques as we go through the course. We will also learn about classes and other stuff related to it as we go through this book.

Microsoft Foundation Classes: creating a Sudoku game. Part 2.

Submitted by pavel7_7_7 on
It's the second part of the article about creating a Sudoku game using MFC. In this part you will read about how to create GUI for this game. The MFC applications are closely connected to the document-view architecture. When you create a project two classes are created: document class and view class. The document class contains the data used in your application.

Microsoft Foundation Classes: creating a Sudoku game. Part 1.

Submitted by pavel7_7_7 on
In this article you will read about the rules of the Sudoku game and the algorithm, used to solve the Sudoku puzzle. In the next two articles I'll describe the complete step by step guide about how to implement a Sudoku puzzle game using MFC. The goal of the Sudoku game is to fill the 9x9 grid with numbers from 1 to 9 in the next way:
  • Each row contains all numbers from 1 to 9
  • Each column contains all numbers from 1 to 9
  • Each block of 3x3 cells contains all numbers from 1 to 9
Here is an example of the solved Sudoku: