C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
In C, memory allocations on heap are done using following three library methods void *malloc(size_t size); void *calloc(size_t nmemb, size_t size); void *realloc(void *ptr, size_t size); Though, most commonly used is malloc() The corresponding free-ing the memory...
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 :
Level: Beginner, Test environment: WinXP SP3 This tutorial is going to teach you how to make a 'DLL wrapper'. Wrappers are own versions of known DLL's. In this case we're going to make a wrapper of a very known DLL known as PSAPI.DLL. If you don't know it then find the information somewhere XD....
A virtual function is used where we want to allow the derived class to replace the implementation of the same function in base class. The compiler always calls the derived class function when called with object of the derived class or an object of base class holding the address of the derived class...
Object oriented programming is a design philosophy. In programming paradigm, object oriented programming is the process by which a problem is decomposed into a number of entities called object and then data and functions are built around these objects. The main advantages of OOP are: ...
Introduction This article talks about Enumerated Data Types and set of guidelines in using them. Background Definition: An Enumerated Type is a user defined data type that maps set of names to numeric values called Enumerators. Enums are generally used when we know all the possible...
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...
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...
While gathering requirements for a software product, we cannot cover all the use cases of the product. If software under development is simpler we might be able to make it fool proof from all angles but large enterprise software products are not easy to develop maintaining high standards of...
To the programmers it is very common concept that bugs are of two types i.e logical errors and syntactic errors. Poor understanding of the problem and solution procedure leads to logical errors whereas, the syntactic errors arise due to poor understanding of the language itself. We can detect these...
Introduction Exception handling is a mechanism when a part of code detects exceptional suituation, it seperates the code where it detects and handles it seperately. This mechanism can be done differently in C and C++, ie eigther using setjmp()&longjmp() or Exception in c++ try/catch(...). ...
Constructors are functions with the same name as the class. They are used to create the instance of a class. They are provided default by the compiler. But still user can have his/her own constructor declared. We can have a constrctor with a single parameter and use this kind of constructor for...
To understand usage of auto and decltype keyword you need to know the existing type deduction facility available in C++98, because auto and decltype are C++11/C++14 extension to the existing feature of the compiler to deduce type from another expression. In case you are not aware of existing type...
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...
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
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.
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
Background I happen to manage many sites this days and so at times I need to upload lots of things to my servers and when uploading from windows PC to Linux servers the biggest problem that comes up is the case sensitive issues and so I tried googling it but what I found are some cool utilities...
1) This Simple program explain one of the use of this pointer in C++. 2) With the help of "this" pointer you can call as many as functions in a sequence. 3) This procedure is called function chaining 4) In this program i have used three different function and through main i have called all...
Talks about what is function hiding and reason behind it. Background In the example given below you would notice that the func() method has different signatures in the base and derived class. Thus its neither a case of function over-riding (which needs same function signature in base and...