C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
This article is to explain in brief how Visual C++ is handling exceptions Abnormal situations should be handled by throwing and catching exceptions. Such situations are not the same as normal error conditions, such as a function executing correctly, but returning a result code indicating an...
Templates, which are sometimes called parameterized types, are mechanisms for generating functions and classes based on type parameters. By using templates, you can design a single class or function that operates on data of many types, instead of having to create a separate class for each type. ...
Introduction Memory allocation for objects is a tough issue, sometimes. Dynamically allocated memory has to be treated specially when one object is used to initialize another. In default constructor a bit wise copy is done when one object is assigned to another, leaving no room for separate...
Polymorphism is in short the ability to call different functions by just using one type of function call. It is a lot useful since it can group classes and their functions together. It is the most important part of Object-Oriented Programming. Polymorphism is the core of object-oriented programming...
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...
Introduction Variables are seen as memory cells that can be accessed using their identifiers. This way we did not have to care about the physical location of our data within memory, we simply used its identifier whenever we wanted to refer to our variable. The memory of your computer can be...
Three major concepts of C++ are Classes, Polymorphism, Inheritance.Let us discuss them in details. Classes A class is the implementation of an abstract data type. It defines attributes and methods which implement the data structure and operations of the abstract data type, respectively....
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...
There are three techniques used to pass variables into a C or C++ functions. Pass by value C/C++ Pass a pointer by value C/C++ Pass by reference C++ only Pass by value The function receives a copy of the variable. This local copy has scope, that is, exists only within the function....
You can add words to be highlighted in the IDE of Visual Studio 6, 2003 and 2005. Steps (From MSDN) In the same directory as msdev.exe (for Visual Studio .Net search for ...\Microsoft Visual Studio.NET\Common7\IDE\devenv.exe), use the Text editor or Windows Notepad to create a text-only...
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...
The size of a class can be changed simply by playing with the order of its members' declaration: struct A { bool a; int b; bool c; }; /*sizeof (A) == 12*/ On my machine, sizeof (A) equals 12. This result might seem surprising because the total size of A's members is only 6...
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...
It's a truly neutral question: given that there are many languages to choose from, why do you choose to program in C++? 1. Compared to many of the other OO languages (i.e. Java, C# etc.), C++ has better support for the functional programming style. 2. Good support for generic programming. ...
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"
Annotation. The article may be interesting for developers who use or plan to use OpenC++ library (OpenCxx). The author tells about his experience of improving OpenC++ library and modifying the library for solving special tasks. Introduction. Introduction. One may often here in forums that...
The essence of the code analysis library VivaCore. Annotation. The article tells developers about VivaCore library, preconditions of its creation, its possibilities, structure and scope of use. This article was written simultaneously with the development of VivaCore library and that's why some...
This program shows how to create the private constructor in C++. #include<iostream.h> #include<conio.h> class Test { int Data; //Stores the Data
The Input/Output system in C++, holds information about the result of every I/O operation. The current status is kept in an object from type io_state, which is an enumerated type (just like open_mode) that has the following values: godbit -> No errors. eofbit -> End of file has been reached...
Annotation. Though the history of 64-bit systems development makes more than a decade, the appearance of 64-bit version of OS Windows raised new problems in the sphere of development and testing applications. In the article there are considered some mistakes connected with 64-bit C/C++ code...