Unions in C are user defined data type similar to structures. Union allows to define multiple members of different type at single location. In this article I will explain what is union, need of union, how to declare, define and access unions in C programming language.
We use unions to define a new data type, similar to structures in C. Its definition, use and access are almost similar to structures. If I say its similar to structure, then you may think why in the world do we need it then. Hence, let us first explore the real world need of a union type.
Continue reading Unions in C programming language, need and use
Structures in C, is an advance and most popular topic in C language. It facilitates you to design your custom data type. In this tutorial, we will learn about structures in C its need, how to declare, define and access structures.
Continue reading Structures in C programming, need and use
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
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?
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
In C programming, pointers and array shares a very close relationship. Array is a data structure that hold finite sequential collection of similar type data. We use array to store a collection of similar type data together. To access and array element we use index. These index starts from 0 and goes up to
N-1 (where N is size of the array).
Continue reading Pointers and Array in C – relationship and use