Dynamic memory allocation refers to the process of manual memory management (allocation and deallocation). Dynamic memory allocation in C is performed via a group of built-in functions
free(). Some text also refer Dynamic memory allocation as Runtime memory allocation.
Continue reading Dynamic memory allocation in C programming
Bitwise operators are used to manipulate data at its lowest level (bit level). Data in memory (RAM) is organized as a sequence of bytes. Each byte is a group of eight consecutive bits. We use bitwise operators whenever we need to manipulate bits directly. In this post I will show you some cool bitwise operator hacks and tricks. These hacks will boost your programming skill.
Continue reading 10 cool bitwise operator hacks and tricks every programmer must know
Data at the centric level is most crucial part of every program that you have written. All programs contain memory allocation, deallocation and data manipulation. In this article, I am going to discuss about memory allocation and different ways to allocate memory in C.
Continue reading Compile time and runtime memory allocation
Files are used to store data permanently on hard disk. C programming supports built in library function to interact with files and directories. I have compiled a list of file handling exercises with solution for beginners and intermediate programmers.
Continue reading File handling exercises and solutions in C
Pointer is a variable that stores memory addresses. Unlike normal variables it does not store user given or processed value, instead it stores valid computer memory address.
Continue reading Pointer programming exercises and solutions in C
Functions makes our program modular and maintainable. Big applications can have hundreds of functions.
Array is a data structure to store homogeneous collection of data. Arrays are equally important as functions. In programming we often use arrays and functions together.
Here in this post I will explain how to pass and return array from function in C programming.
Continue reading How to pass and return array from function in C?
Write a C program to input elements in an array and print array using pointers. How to input and display array elements using pointer in C programming.
Input array size: 10
Input elements: 1
Array elements: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Continue reading C program to input and print array elements using pointers
In this ongoing C programming tutorial series, we learnt many concepts related to function and pointers. Let us give a quick recall.
A function is a collection of statements grouped together to perform a task. Function encapsulates behaviour and allows us to write modular and reusable code. Instead of writing same code to perform an action 'A' repeatedly, we call a function that encapsulates action 'A'.
Continue reading Function pointer in C
Pointer is a variable pointing at a memory location of specific type. Type defines many important properties related to the pointer. Such as valid memory addresses it can point, pointer arithmetic, etc.
As per C programming semantics, you must specify pointer type during its declaration. Also, it is illegal to point pointer of one type to object of another type. For example,
int pointer cannot point to a
Continue reading void pointer or generic pointer in C – use and arithmetic
Pointers are the most powerful as well as complex component of C programming. For newbies, it’s like learning rocket science in C. However, I have tried my best to simplify things.
In this ongoing series of C programming tutorial, I have explained many concepts related to pointers. Here in this section we will focus on some confusing pointer terminologies. We will learn and compare constant pointer with pointer to constant and constant pointer to constant.
Continue reading Constant pointer and pointer to constant in C