Builtin GCC Functions - __builtin_clz(); __builtin_ctz(); __builtin_popcount();
GCC provides quite a lot of builtin functions. These functions are part of standard C offered by the compiler and may come in various variants as per the gcc. These are also termed as hardware specific...
View ArticleC Memory Allocation
When an ELF executable is executed, a process is created and its process image is create in the RAM. However, it is here in the process image in RAM, all the variables are assigned memory. Sometimes...
View ArticleUnions in C : A less used but a powerful feature of C
WHAT IS A UNION A union, is a collection of variables of different types, just like a structure. However, with unions, you can only store information in one field at any one time. You can picture a...
View ArticleUnderstanding float datatype in C
Pretty sure, one must have used the datatype ‘float’ numerous number of times since the day one has started programming. However, there are many times, when we mishandle floats and doubles, or get...
View ArticleComplete Guide to Understanding static in C
The keyword ‘static’ has been widely used in many programming languages. I know it is there in Java, C and C++. I am pretty sure, it is must be used in other languages as well, even though it might...
View ArticleInFix to PostFix and PostFix expression evaluation.
InFix to PostFix Introduction Infix Expression : Notation in which the operator separates its operands. Eg (a + b) * c. Infix notation requires the use of brackets to specify the order of evaluation....
View ArticleError Handling in C
Error handling has always been dominantly vital in programming. It has become a bit more sophisticated with the object oriented languages, however even in the system programming language like C, error...
View ArticleWorking with Bitwise Operators
As it is said, great things are in small ones. Its someway true in C as well. Working on bits rather than bytes, and other bigger data structures leverage implementations in speed and space efficiency....
View ArticleA Beginner's Guide to Pointers
Introduction Definition: Pointer is a variable which stores address of another variable. To understand this definition properly, let us separate it into two statements: 1. Pointer is a variable. 2. It...
View ArticleStrings in C
Strings are paramount datatype for any real use case scenario. However, in C, there is no basic datatype as ‘string’. A string is understood as a collection set of characters i.e. in programmatic...
View ArticleCalculator program in C
The below code is a calculator in plain C. It does not take into account the operability of bodmas but just one operation at a time. The main thing in the source code below in the scanf which scans the...
View ArticleATOI and ITOA Custom Implementations
I wanted to make a remake of my previous BAD versions of these 2 functions. I think they are working great now, and they're portable the same as the originals from STD library. ATOI Code: /** // By 85...
View ArticleSimplex and Dual Simplex Method
C Program to solves linear programming problem or LPP by "SIMPLEX" and "DUAL SIMPLEX" method. The code Simplex Method Code Code: #include <stdio.h> #include <conio.h> #define INFINITY 999...
View ArticleSolution to Problem When using scanf() before fgets() or gets() in C
There are a certain functions in C, which if used in a particular combination may cause problems. These problems are due to the conflicting behaviors of the functions. In this article, we will...
View ArticleConditional Statements in C - if else break continue switch
Conditional statements are statements, which are executed depending on some condition being satisfied as true or false. In this tutorial, we will try to learn some conditional statements which include:...
View ArticleLoops in C - for while do while and goto
Loops are the basic logic building structures in computer programming. It is a way of executing statement(s) repeatedly in specified times, which is termed as iteration. Here different types of loops...
View ArticleC Arrays
Array is a data structure consists of a group of elements of same data type. We can think it as collection of variable of similar data type. Array prototype: Code: Data_type array_name[array_size]...
View ArticleCustom Data Types in C - struct, union and typedef
There are many built in data types in C. But sometimes, the built in data types are not enough to perform the required tasks. In that case, some custom data type can be built to meet the necessary...
View ArticleC Functions
Function is a block of statements that performs a specific task. It is reusable portion of the code and a very effective way to modularize your program. For example, you may need to perform different...
View ArticleUnderstanding C File Handling Functions With Examples
Data files are very essential part of in computer programming. The data we use while programming using the variables of different data types, are unavailable after the program execution. So,there is no...
View Article