C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
How to make your program to be fast. 1. Use Pre Increment or Pre Decrement in place of Post Increment or Post Decrement operator. i.e. use ++i or --i in place of i++ or i--. Because ++i operator take increment and save it i.e. One CPU Instruction is required for it. and in case of i++...
In this article, I'll present some interesting 'C' problems for which I will not provide the answer. If you are not bale to solve any problem, then just leave a comment here so that everybody is benefited when the problem is discussed. Problems 1) Will the program execute without any problem?...
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 understand the problem caused by using one such combination of functions scanf() and fgets()/gets(). ...
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 functions which are internally implemented in assembly or we can say machine instructions, with...
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 way to retrieve the data if we further need. Here comes the necessity of data files. FILE...
I worked for a long time for this article. This program is tested on Sun-Solaris system using gcc compiler. In market, there are a lot of tools for detecting the memory leaks. Here I made a program which has to include in your source file and it will tell the desired informations to find where...
Huffman encoding is a compression technique used to compress data for transmission.This program takes string as input from user and shows its encoded form as output with some intermediate outputs as well. The purpose of it is to reduce the number of bits used for each character for its transmission...
Introduction Itís my first post here. I will discuss on Date & Time Management Functions of C. Though if someone is only interested about getting the time and date, then it can be done by some trivial function but the goal of this detail discussion is understanding the bios as well as...
I recently faced a problem regarding these 2 Escape Sequences. So, I thought I should share the difference between these two to clarify to all who may hay have confusion like me. Thanks to Shabbir too...... The Difference There are a few characters which can indicate a new line. The usual...
This article assumes that readers are aware of what pointers are and how they are used in 'C'. As a quick overview, A pointer is a special variable which holds the address of a variable of same type. For example : Lets say there is a variable 'int a=10' so,a pointer to variable 'a' can be...
/*question number 1*/ int z,x=5,y=-10,a=4,b=2; z = x++ - --y * b / a;What number will z in the sample code above contain? Choice 1 5 Choice 2 6 Choice 3 10 Corrected by buddy by running the program Choice 4
There are times when you write a small or a big code and when you execute it you get a very small and precise output 'Segmentation fault'. In a small piece of code its still easy to debug the reason for this but as the code size grows it becomes very difficult to debug. Here in this article, I am...
Hello My first game of TicTacToe and thought I will put the same here after the Game of Mojo and Max 8 Note :- This will compile in Turbo C 3 Only and the zip contains the executable Version also for you to see. #include <iostream.h> #include <conio.h> #include <stdlib.h> ...
We will understand a very important function 'fstat()'. We will create a working code to describe the capabilities of fstat() but before that lets theoretically Understand what it does. fstat() as the name suggests is used to get the status of the file. By status we mean all the useful...
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 : ...
C program to check whether a year is a leap year or not. /* ** C program to check whether an entered year is a leap year or not ** @author: Pradeep ** @date: 02/12/06 */ #include<stdio.h>
Introduction In computer Science and mathematics sorting is any technique that puts elements of a list in a certain numerical or lexicographical order.We will discuss some of the commonly used sorting algorithms which has been implemented in various high level languages like C, C++,...
Most of the newbie programmers are fascinated by the term 'hacking' or 'cracking'(to be precise). Generally, they see some weirdly written code (that may visually seem like a painting to any new programmer) and start dreaming of the developer who has written the code as god of programming or...
malloc allocates certain amount of memory during program execution and free de-allocates memory previously allocated using a call to functions like malloc, calloc or realloc. Memory leak can occurs when a program allocates memory but does not release it. Understanding malloc() & free() ...
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...