C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views
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...
2
2,272
In this article, we will discuss different implementations of sleep functions that had flaws to understand how sleep function evolved. Before discussing the sleep function implementations, lets first understand briefly the following two functions : alarm() function From Linux Man page : ...
0
2,252
Signals are the interrupts. They are a way of providing asynchronous events. For example a user typing ctrl-c on terminal to stop a program. Most of the programs need to handle signals. Every signal has a name like SIGxxx. For example : SIGALRM is the alarm signal that is generated when the timer...
1
4,115
Refer to the recent articles on Understanding File Handling Functions in C & Understanding Advance File Handling Functions in C C communicates with files using a new datatype called a file pointer. This type is defined within stdio.h, and written as FILE *. A file pointer called output_file is...
11
72,847
We all have been using Functions since we stepped into programming. Numerous times we have called a function with some arguments to it. We all know that the basic declaration of a function is : <return-type><function-name>(<comma seperated list of arguments>); For example : int func(int...
0
2,115
Typecasting is simply a mechanism by which we can change the data type of a variable, no matter how it was originally defined. When a variable is typecasted into a different type, the compiler basically treats the variable as of the new data type. Example Lets go for a very simple example : ...
6
14,967
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...
0
2,157
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...
0
1,892
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...
0
1,760
Introduction This article talks about some general tips while using pointers in an Application. Background While working with different kinds of errors, generally detecting an error is easier than fixing it. When it comes to pointer, the error is usually the result of a pointer pointing...
6
6,017
Introduction Mouse has revolutionized the computer world. In GUI mouse is very essential for user interaction. it is a simple input device which allows you to point and execute interface in a random and faster manner than the keyboard which provides sequential interface. Mouse Programming is a...
9
33,019
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...
0
2,271
This is the third article where I will tell you about a couple of new programming methods that can help you make your code simpler and safer. You may read the previous two posts here and here . This time we will take samples from the Qt project. Introduction It was not accidentally that I...
2
3,192
Integers is a fundamental data type in a C program, They are used to represent a finite subset of mathematical integers, C Provides us with a suite of functions, and quite a lot of modifiers for manipulating these integers , but if these functions and modifiers are not used properly and carefully...
3
5,043
Processes are the primitive units for alocation of system resources...Each process have their own address space and usually one thread of control. The process which makes another process is called the parent and the process which it makes is called a child process..As we know every process have its...
14
8,812
The article explains why hashing have o(1) complexity. This article will clear your doubt that whay hashing has 0(1) time complexity but will not take you deeper . There are certain factors which can affect the time complexity like collision and performance of hashing depends on hashing algorithm....
3
6,110
EIP ( Extended Instruction Pointer ) is a register that points to the next instruction...It simply points to the address in which that instruction is placed...So if we overwrite this we can change the direction flow of the program and make it do what we want.... In other words if we overwrite...
2
8,518
Note : The following source will only work with non-chunked encoding servers...The servers which have enabled the encoding set to chunked will not properly work with this source... And I assume basic knowledge of SOCKETS UNIX API and C language as prerequisites... Source #include<stdio.h>...
5
7,372
Generally a question is asked that if you have given n bits then print out all the possible binary numbers of n bit and so I will try to explain how to get that done. Please don't Copy Paste. Understand The logic because it is useful in other problems as well for eg if n=1 then you can have 0...
2
7,998
Refer to the recent articles on Understanding File Handling Functions in C & Understanding Advance File Handling Functions in C Opening A File Before we can write information to a file on a disk or read it, we must open the file. Opening a file establishes a link between the program and the...
14
318,566