C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
This article talks about Association, Aggregation and Composition Relationships between classes with some C++ examples. Background Association is a simple structural connection or channel between classes and is a relationship where all objects have their own lifecycle and there is no owner. ...
8
101,624
Pointers and Reference looks similar but there are some difference between both of them. POINTER Its not necessary to initialize the pointer at the time of declaration. Like int a = 10; int *P = &a; //It is not necessary Another way is :
33
88,373
A Simple program for implementing Linked Stack #include<stdio.h> #include<stdlib.h> #include<conio.h> struct node { int data;
8
78,596
After having so many articles on Linked List Basic operations in Linked List Swap two nodes of a linked list Move forward a node in linked list Insert a node in a linked list Double linked list Double circular linked list Circular linked list Priority Queue implementation using Linked...
13
73,988
Introduction - What is priority Queue A priority queue is an abstract data type (ADT) supporting the following three operations: 1. Add an element to the queue with an associated priority 2. Remove the element from the queue that has the highest priority, and return it 3. (optionally)...
17
63,443
Many of us might have wondered at sometime or the other about how to pass a variable number of arguments to C++ functions : something like a printf function. I don't know how many are aware of this, so I decided to post an article on this topic. Background When a function is declared, the...
13
57,485
Oracle C++ Call Interface (OCCI) is an Application Programming Interface (API) that provides C++ applications access to data in an Oracle database. This API is a significant improvement to the Oracle Call Interface (OCI) API as far as ease of use is concerned. Engineers who have written JDBC (Java...
40
57,302
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
51,839
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
48,011
Introduction This article talks about how virtual table or vtable and _vptr works, with a pictorial representation. Background Virtual Table is a lookup table of function pointers used to dynamically bind the virtual functions to objects at runtime. It is not intended to be used directly...
16
42,296
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
39,886
Sometimes its very difficult to understand which function would be call. So, this example explain you about how member functions are called while using virtual and without virtual. 1) Example of Virtual Function In the case of virtual function when we call the member functions.The compiler...
6
36,050
Introduction This article talks about size of a class with all possible scenarios like having simple data (with and without structure padding), virtual functions, Replicated and Shared Multiple Inheritance etc. Background Size of a class object is nothing but it's non-static member data +...
7
35,953
Introduction To Binary Trees A binary tree is made of nodes, where each node contains a "left" pointer, a "right" pointer, and a data element. The "root" pointer points to the topmost node in the tree. The left and right pointers recursively point to smaller "subtrees" on either side. A null...
1
34,502
When you compile the following code in VS 6 you get the output as #include <iostream.h> #include <stdio.h> void main() { cout<<"hello"; printf("hi"); } hihello
7
33,900
Introduction Code for LinkList in C++ The code #include "LinkedList.h" /** * Construct the list
4
33,148
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
31,115
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
29,276
Function pointer - how to declare function pointer in structure and how it call ,see it. #include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct strfunptr { float a; float b;
3
26,524
Memory pools allow dynamic memory allocation comparable to malloc or the Operator new in C++. As those implementations suffer from fragmentation because of variable block sizes, it can be impossible to use them in a real time system due to performance. A more efficient solution is preallocating a...
6
25,990