C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
We will discuss the concept of Macros. A Macro is a name given to a piece of code or to a value. Whenever the macro is used in the code, it is replaced by its value at the very first stage (preprocessing stage) of compilation process. They are defined using '#define' directive. For...
This time we checked Apache HTTP Server with PVS-Studio. As we had expected, we found errors there. The errors are few. We expected this either. Other developers come across this situation too while testing PVS-Studio on their projects. Unfortunately, the first conclusion you would like to draw...
The fork() unix API provides mechanism to spawn a new process from an existing process. This function is called once in a program but it returns twice. Once in parent process and once in its child process(the new spawned process becomes the child process).The return value of this function in child...
In this tutorial, we'll be looking at the code structure of the 'echo' utility and will try to understand how it works, for those who are unfamilliar with the 'echo' utility, its one of the most basic and most useful utilities in a shell it prints out its arguments on the standard output, if you...
Continuation of Developing Linux Utility like 'ls' in C series. In the first part we studied a code that was developed to behave like a basic ls utility. Here in this part I have extended the code to give output in alphabetical order. The code Here is the code : ...
If you are a developer then you would definitely be aware of the concept of temporary files. Temporary files, as the name suggest is temporary in its persistence. Either a process creates a temporary file to hold data for certain time or to pass information to another process. An ideal process...
If you work 3-4 hours daily on coding in C/C++ then there ought to be some programs, logics, tricks, tips etc which you come across daily. Some are new to only you while others are interesting enough to be shared. Here in this article, I am going to share one interesting program and how I went...
This is the fourth post in which I want to share with you some useful observations on error patterns and the ways of fighting them. This time I will touch upon the subject of handling rare and emergency conditions in programs. While examining a number of applications, I came to a conclusion that...
Continuing the previous discussion that we did on Unix Threads (Basics) , today we will discuss the concept of 'Thread Synchronization'. Going through a quick recap, we now know that threads are used to make calls to functions non-blocking (asynchronous). One important point that we did not discuss...
What are format strings Format strings are strings that are used to render and arbitrary number of varied datatype parameters into a string when given as a input to string formatting functions like printf, sprint etc. Understanding 'printf' 'printf' is a standard format string function in...
At times certain tasks need more time to execute and when multiple such tasks are desired then blocking on a single task is not a good practice. To Understand, Think of a program that provides some service but this service takes time to execute. Now, if you want this service again and again then...
Abstract Introduction The interview text References Abstract This is an interview with Dmitriy Vyukov - the author of Relacy Race Detector (RRD) tool intended for verifying parallel applications. In this article you will learn about the history of creating RRD, its basic abilities and...
Introduction The idea is simple just to test whether the expression contains correct sequence of brackets or not. void main() { char arr; char *top; int loop=0,i,l,binary;
In the previous tutorial we talked about functions, What are they, How to declare them etc. Now in this article we’ll be looking at In this tutorial we’ll be looking at a basic sample program, how it works and some basic rules/tips to keep in mind. Simple Program using Functions Function.c...
In this tutorial we’ll be learning about LOGICAL operators in C , What are they and How they can be used. These are also a fundamental part of C programming Language, and You’ll find them in almost every useful code using conditions. Note : C Generally denotes 1 for True and 0 for False. (While...
What is a Function? A Function is a statement or a rule which relates a variable quantity with other variable quantities. The function can often be related to a machine , it has an input and a output , The output is somehow dependent on the input. For more clarity lets take an example of a...
When you write program then there are lots of function and variables used to store value on execution time. So how can you define variable or function in such a way that when execution over then it will release memory storage automatically. Answer is C storage, here you can define function or...
In this tutorial we’ll be making our first running C Program, It will simply print out a Message on the Screen! So let the coding begin. :party: hello.c #include<stdio.h> int main() { printf("Hello World! This is my first C Program "); return(0); }
In this tutorial we’ll be learning some mathematical operations in C (multiplications, divisions , additions , subtractions , modulus) So let’s get started Almost all mathematical operations in C follow the following syntax :- … The ‘…’ indicates that any number of terms (>2) can be...
The while loop is a statement used in some programming languages (including C) to execute code repeatedly, this allows a programmer to execute a set of instruction multiple times until a condition is met. It is one of the simplest looping structure in C and basically follows the following...