C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
Views
We decided to write several small posts on how C/C++ programmers play with fire without knowing it. The first post will be devoted to an attempt to explicitly call a constructor. Programmers are lazy creatures. That's why they tend to solve a task using minimal code amount. This aim is...
0
2,634
In C-Style typecasting we discussed about type casting and why is it required and how it is used in C programming. C++ has more types of typecasting and an entirely different way to use them. A point to be noted that C++ typecasting would be mostly described and used in context of classes, as...
0
2,547
Being an experienced C/C++ developer, sometimes there are modules in which the code layer which interact with the system is written in C while the layer above it is written in C++. Have you ever thought of how these two layers (one written in C and other in C++) interact? What if we want to call a...
0
3,267
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,478
Good has won this time. To be more exact, source codes of the Chromium project have won. Chromium is one of the best projects we have checked with PVS-Studio. Chromium is an open-source web-browser developed by Google and intended to provide users with fast and safe Internet access. Chromium...
3
2,730
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
52,457
This example shows how to create the linklist without Loop. #include<iostream.h> #include<conio.h> //Structure of the Doubly Link List Node. // Data stores the value of type integer. struct Node
9
6,822
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,491
Introduction In C++ programs there is use of common data structures like stacks, queues and lists. A program may require a queue of customers and a queue of messages. One could easily implement a queue of customers, then take the existing code and implement a queue of messages. The program...
6
4,881
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,948
Introduction Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data. The...
3
6,304
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,754
Introduction This article talks about Function Object and it's uses over Function Pointers Background A Function Object, is an Object of a class that defines an operator () and can be called as a function. When a function object is used as a function, the function call operator() is...
3
5,492
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
58,157
Programmers, meet a new tool to search for errors in source code of software written in C/C++. Within the scope of the PVS-Studio analyzer, we implemented a new set of general-purpose rules. This functionality is free for now. You may download PVS-Studio here...
0
2,825
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,305
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,101
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,125
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,763
Find roots of any linear algebraic nth order equation by Regula Falsi method The Code #include <stdio.h> #include <conio.h> #include <math.h> #define ACC 0.00001 #define N 10
1
3,047