C tutorial
C Storage Classes
Variables point to a memory location that has an address and a value stored. Other than this value, a variable also has a storage class.The C storage classes decide the characteristics of a variable during the execution of a program – the characteristics are storage location, initial value stored, scope, the lifetime of the variable … Read more
C Data Types
Data types are a very important concept in programming languages. You can choose the right kind of variable types for your program. The data types depend on the compiler which creates machine codes suitable for 16-bit or 32-bit processors.Sometimes when the processor has backward compatibility, then a 32-bit processor can run a 16-bit machine code … Read more
C Variables And Constants
In a C program, some values do not change and some changes with the execution of the program. A constant never changes throughout the program and the variable changes frequently, hence the name. Types of ConstantsConstants can be classified into different types such as numeric constants and character constants. The following figure depicts the types … Read more
C++ Private Member Function & Nested Functions
You have learnt about member functions earlier. We now expand the idea and talk about private member function and nesting of function in C++.A function declared inside the class’s private section is known as the “private member function”. A private member function is accessible through the only public member function.Data MembersData members include members that … Read more
C++ File Pointer And File Manipulators
What is a file pointer? A pointer is used to handle and keep track of the files being accessed. Every file maintains two pointers called get_pointer (in input mode file) and put_pointer (in output mode file), which tells the current position where reading or writing will take place with the use of opening modes and their … Read more
C++ Virtual Functions
In this article, you are going to learn about an important concept in C++ called the virtual functions and pure virtual functions. However, it is recommended that you learn about basics of pointer, classes and derived classes before reading further.What is Virtual Function? A virtual function is a special type of member function that is declared … Read more
C++ Pointers To Derived Classes
We know that pointers are used for an object of derived classes, we can also use them for the base objects. The pointer to the base class object is type-compatible (can be used in two ways) with a pointer to the object of the derived class. To access the variable of the base class, a base … Read more
C++ Pointers To Objects
To understand the topic of pointers to objects, we need to know what is an object , pointer and class. A class is defined in C++ using keyword class followed by the name of class. The body of class is defined inside the curly brackets and terminated by a semicolon at the end.What is object?Object is … Read more
Preprocessor In C++
Understanding c preprocessor includes the source code which is written by programmers is stored in the file “program.c”. The file that is stored then processed by preprocessors and an expanded source code file is generated as named program.This expanded file is compiled by the compiler and an object code file is generated as named program … Read more