C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
Views
Introduction Here is the code for a threaded binary tree. The basic difference between a binary tree and the threaded binary tree is that in the binary trees the nodes are null if there is no child associated with it and so there is no way to traverse back. But in a threaded binary...
8
30,219
Making a Phone Book application in C++ is interesting; because it lets you learn the language practically. Making sample applications in any programming language is an interesting job. And this is perhaps the best approach to learning any programming language. As a programmer, your goal is to...
0
2,958
All possible combinations of a string 1. Finds all possible cominations of a given string. The total number of combinations with recurrences is the factorial of the string length. 2. Have given the word 'post' as an example since if I included a cin >> word; then a user may unconscientiously...
20
40,723
Introduction Here is a code in which i have created for the string class. This article tells how we can implement the functions of a string through making it a class. //Header Files # include "classfile.h"
6
4,411
Definition : Class which Can't be inherited by other class, that class is called final class. You all knows that final class is inbuilt in java. But in C++ you have to create final class.Two types of Final class, you can create . One who want to create object of final class on Heap and other who...
6
19,981
Originally written by Zeeshan Amjad Assumption: 32-bit Machine. Here I am going to explain How Virtual table, Virtual pointer for Virtual functions are internally working. First we have understand memory layout. Example 1: How the class's memory layout class Test
48
32,087
This is very simple if you think in a simple manner. A magic square is represented in a matrix form. May be all of you know this formula to satisfy magic square rule i.e. for size of matrix n*n sum of each row or column or diagonal should be n/2. means for n=3 , sum(row or column or diag)...
34
20,353
This is just for a kind of information. Here I am going to explain how to make a class so that user can create object of it on free List( heap memory) or Stack. Example 1: Object should be created Only On Heap memory.Idea is that make constructor as private so that no one create on stack....
5
9,520
Background Normally most of software Engineer uses singleton design pattern in daily coding life. It's very simple , vast uses but still i saw in many softwares which is not handled proper in C++ based products/projects. One thing more you can'nt design singleton as perfectly behaved singleton....
10
5,970
If two process are there and one shared memory is there. One wants to write the data and another wants to read the data to the shared memory. I have written a program in which if process1 is writing to shared memory another will wait and vise varsa. To undersand these programs one should have...
34
50,427
I will explain how to create a directory in linux using a c++ program. The program to create a directory is as follows: #include<iostream.h> #include<sys/stat.h> #include<sys/types.h> using namespace std; main()
16
54,169
Introduction This article discusses about the Two Dimensional To Three Dimensional conversion and vice versa in c++ The following program converts two dimensional array to three dimensional array using TwoDimToThree() and converts three dimensional array to two dimensional array ussing...
2
6,779
Printing the date from starting date to ending date The program takes the starting date and ending date as inputs and prints the dates in between them.This program is useful if u r dealing with dates. The code I have used four date functions i.e date1() , date2() , date3() , date4(). When...
8
3,788
Another method for printing the date from starting to ending This method is useful if u r dealing with dates.If u want to do some operation using the date and then fetch another date and do vice versa it is useful. #include<iostream> #include<malloc.h> using namespace std; int ...
1
2,693
We recently saw a tutorial on Vectors in C++. Now its time for better things. So we all know what a set is. It is a group of elements in which there is no duplicate. Consider we need a container with following features: -> add an element, but do not allow duplicates -> remove elements -> get...
2
2,601
We have all been using screensaver's since the time we first entered the world of computers. Everyone of us must have thought how one can make a screensaver of his/her own. Screensavers were originally meant to prevent damage to phosphorus coated computer screens. Now they are mostly used for...
1
9,320
We have all read about C++ Standard Template Library. It provides generic code for data types. Like vectors, pairs, list, sets, maps, etc. Today we'll take a good look into Vectors. VECTOR We have all been using arrays to store elements. But you must have thought at one point or another,...
3
3,512
I thought of adding this small code snippets to thelibrary which just reverses the content of the array. Not sort in ascending/descending order, but put last array entry to first, etc. EG.. if array consists of {2,3,4,7,12,98},, need to output {98, 12,7,4,3,2} #include <iostream.h> #define...
9
6,935
Complete Binary tree program done in C++ including Inorder, Preorder and Postorder Traversal. #include <iostream.h> #include <stdlib.h> enum {TRUE = 1,FALSE = 0}; typedef struct _node {
2
15,546
Finds INTEGRAL of f(x) by Trapezoidal and Simpson method Simultaneously TRAPEZOIDAL RULE :- Integral of F(x) in between the limits a and b is given by =(h/2)*(y+2(y+y+y+..y)+y) where y=F(x), x=x+h, h=(b-a)/n.
3
4,528