C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
One benefit of C++ over C is its exception handling system. An exception is a situation in which a program has an unexpected circumstance that the section of code containing the problem is not explicitly designed to handle. In C++, exception handling is useful bcause it makes it easy to separate...
Introduction A C++ class with lots and lots of comment on each line for you to understand what each line does and how the program flow works. The Code #include <iostream> // Included for cout
When exceptions occur, the programmer has to decide a strategy according to which he would handle the exceptions. The strategies could be, displaying the error messages on the screen, or displaying a dialog box in case of a GUI environment, or requesting the user to supply better or simply...
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...
Problems of testing 64-bit applications. Andrey Karpov Evgeniy Ryzhkov http://www.Viva64.com March 2007 Abstract. The article observes some questions related to testing the 64-bit software. Some difficulties which a developer of resource-intensive 64-bit applications may face and the...
Operator overloading is an extremely exciting feature of C++ language that allows you to simplify complex code into more readable and easy to understand code. For example what if we want to add two objects? Usually we will define some addition function that takes object to be added as a parameter...
Whenever you hear the word virtual, the first thing which comes to your mind is something that only exists in appearance but in reality you cannot physically see or touch that thing. A virtual function in C++ is a similar concept. Virtual functions lays at the heart of object oriented programming...
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...
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
Today I am going to explain another very important C++ concept: ’The Data Type Conversion in C++’. C++ has wide variety of data types ranging from the basic or primitive data types to the user defined data types. In this article, we are going to explain that how we convert these data types to...
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...
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...
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...
Multithreading is one of the most fascinating feature of modern day programming. If you are not familiar with multithreading then most probably you have been writing programs that are single threaded. By single threaded program we mean such a program where program instructions run in a sequence and...
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...
Introduction This article talks a little bit about Smart Pointer conepts and then move on to Reference Counting. Then there is a smaple code to implement the same. Background Smart pointer or auto-pointer is a simple wrapper around a regular pointer, provides all meaningful operations to...
Introduction This article talks about Static in C++. Background Static Variables: 1. All static variables are stored in Data Segement.
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...
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...
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. ...