Pointers : In Simple Terms

Before starting a pointer first clear basic concepts of a variable. A variable is nothing but a name given to a storage area that our program can manipulate. Each variable in the C has a specific type which determines a size and the layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable. When we declare a variable like int no = 21; Then it does get 4 bytes of memory and inside that memory…Read more

Static Members and Static Concept

The static concept in C and C++ is different. When we create the static variable in the C its scope is limited means inside its .obj file only. But in the C++ when we create the static member its single copy can be shared between all the objects of the class. Memory allocated for the static members is on the .bss or non bss section. We can initialize the static members inside the constructor like the non static members, or we can initialize it after the class definition like int demo::i=10; Value for…Read more

Virtual Functions in C++

Important points about Polymorphism and Virtual Function   Polymorphism is the third important feature in C++ after data abstraction and inheritance. Polymorphism means single name and multiple meaning. There are two types of polymorphism like compile time polymorphism and run time polymorphism. We can achieve compile time polymorphism using the function and operator overloading. We can achieve run time polymorphism using the virtual functions. In case of function overloading we can write the multiple function having same name inside a single class. And when we call that function the call is bind with…Read more

Pointer Arithmetic

Do you want to be a Master in C? then you should have to know about pointer arithmetic. Referencing a Pointer: • Referencing the pointer means storing the address of particular object into the pointer variable. For ex: int no = 10; int *ptr = & no; • In this example we store the address of no variable in a pointer variable ptr. & operator is used for retrieving the address and it is called as "address of operator ". • This “&” operator is not used for an array and a function…Read more

Storage Classes in C

Storage Classes in C   Friends we will be going step by step learning C, will find meaning of each new term when we get introduced to it while learning storage classes. Storage is related with Scope of a variable: It is the boundary within which a variable can be used. Memory allocated by compiler for storing variable   Storage class defines the scope and lifetime of a variable. With C complier view we can say that variable name identifies physical location from a computer where variable is stored. As we know that…Read more
Introduction to C

Introduction to C

OVERVIEW OF C C language was originally developed for UNIX operating system. Over a period of time C started getting widespread support with increasing popularity of UNIX. It has capability to interact with hardware. A SIMPLE PROGRAM IN C #include<stdio.h> Void main() { printf(“hello this is my first program in c language”); }   Above program just prints “hello this is my first program in c language “ on screen. The first line #include<stdio.h> is a directive which is used to include the header file stdio.h in program stdio.h contains all standard input…Read more