≡ Menu

C Programming

C Recursion Fundamentals Explained with Examples

In C programming language, when a function calls itself over and over again, that function is known as recursive function. The process of function calling itself repeatedly is known as recursion. In this tutorial, we will understand the concept of recursion using practical examples. 1. C Recursion Concept Lets start with a very basic example [...]

{ 14 comments }

Structures, Unions and Bit fields are some of the important aspects of C programming language. While structures are widely used, unions and bit fields are comparatively less used but that does not undermine their importance. In this tutorial we will explain the concept of Structures, Unions and Bit fields in C language using examples. 1. [...]

{ 13 comments }

Buffer overflow attacks have been there for a long time. It still exists today partly because of programmers carelessness while writing a code. The reason I said ‘partly’ because sometimes a well written code can be exploited with buffer overflow attacks, as it also depends upon the dedication and intelligence level of the attacker. The [...]

{ 36 comments }

Many C and C++ programming beginners tend to confuse between the concept of macros and Inline functions. Often the difference between the two is also asked in C interviews. In this tutorial we intend to cover the basics of these two concepts along with working code samples. 1. The Concept of C Macros Macros are [...]

{ 12 comments }

Binary tree is the data structure to maintain data into memory of program. There exists many data structures, but they are chosen for usage on the basis of time consumed in insert/search/delete operations performed on data structures. Binary tree is one of the data structures that are efficient in insertion and searching operations. Binary tree [...]

{ 34 comments }

How to Avoid Stack Smashing Attacks with GCC

Stack smashing is a fancy term used for stack buffer overflows. It refers to attacks that exploit bugs in code enabling buffer overflows. Earlier it was solely the responsibility of programmers/developers to make sure that there is no possibility of a buffer overflow in their code but with time compilers like gcc have got flags [...]

{ 6 comments }

C argc and argv Examples to Parse Command Line Arguments

Whenever you execute a program on a terminal, you can pass some arguments that are expected by the program, which can be used during the execution of the program. Here, system provides internal facility to maintain all arguments passed from user while executing program. These arguments are known as “Command line arguments”. In this tutorial, [...]

{ 10 comments }

Control conditions are the basic building blocks of C programming language. In this tutorial, we will cover the control conditions through some easy to understand examples. There are two types of conditions : Decision making condition statement Selection condition statement Let’s understand these two types with the help of examples. Decision making condition statement Conditions [...]

{ 8 comments }