C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views
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++,...
12
6,308
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() ...
0
2,434
After writing my previous article Virus Code in Linux - C Code That Changes it's Process Name Run Time, I wondered if a process can change its name then why cannot it change its PID. And what if a process can change both its name and PID after lets say every 1 second? Well it will be a difficult...
0
4,034
Continuing my previous article Understanding File Handling Functions in C, here in this article let us focus on functions like : fread() // read a chunk of data from file fwrite() // Write a chunk of data to file feof() // Check for end of file indicator ferror() // Check for error...
0
4,637
Being a Linux system programmer there are numerous situations when one needs to deal with files kept on disk. Like opening a file, reading a file(one character at a time, one line at a time, the whole file at a time), seeking in a file and then finally closing it. One can use various library...
0
6,786
The other day I was searching a bit on Linux viruses on Internet. Though there are quite a few now but still cannot be compared with the volumes that we have on windows. Another thing that I found was the permission robustness that Linux file system has as compared to windows OS. So, whiling...
0
3,589
As the name suggests, volatile specifier indicates the compiler that the value of the variable is volatile i.e. it can change unexpectedly. But, the question comes why do we need to even specify that a variable value is volatile. The Requirement for volatile specifiers Our compilers...
1
2,822
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...
0
1,932
If you are an experienced C/C++ programmer then you must have definitely observed some weird behaviors of code in certain situations. These weird behaviors can be due to various reasons but most of them are because of stack corruption. For all those who have no idea about what stack corruption is,...
0
4,822
The motivation behind writing this article came from the fact that there are still many books/tutorials/softwares etc where I have seen 'void main' being used instead of 'int main'. Still most of the C/C++ newbies are taught to start practice coding with 'void main'. Even I started practicing C in...
2
3,345
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>
12
131,859
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?...
20
5,456
Environment variables can be thought of as a name value pair that affect the behavior of the processes running on an operating system. For example, to know the value of environmental variable PATH in my system, I do : -laptop ~ $ echo $PATH ...
0
2,281
Today we will discuss about Sockets programming paradigm, elements of Sockets applications, and the Sockets API. The Sockets API allows to develop applications that communicate over a network. The network can be a local private network or the public Internet. An important item about Sockets...
7
32,281
A lot many times you would have used a Linux command with some arguments to it. Like : cp -r /home/user/Desktop/abc /home/abcrm -rf abcIn the above examples, 'cp' or 'rm' are the name of binaries (written in 'C') while the rest of the stuff is the command line arguments to the respective...
2
4,883
Here is the code which displays the Calendar of the month entered by the user. #include<stdio.h> #include<conio.h> #define Y 1900 /*1/1/1900 monday*/ void days(int *,int *); void display(int *, int);
5
3,380
The phenomenon of stuffing excessive data which is beyond the capacity of the allocated memory is known as buffer overflow. In Simple words we can say that for lets say 'n' bytes of memory, if we try to store any number of values which is greater than 'n', then the values beyond the nth value will...
9
3,027
Suppose a system call was blocked due to some reason (like waiting for a read of some data on terminal) and during this time a signal occurs. Do you know what happens in this scenario? In this article we will discuss the impact of signals on system calls. System calls are different from...
2
3,042
Before we start with Non re-entrant Functions, Can you guess the problem with this piece of code : #include<stdio.h> #include<signal.h> #include<unistd.h> #include<stdlib.h> int flag; char *s;
2
3,033
Function pointers are pointers that can hold the address of a particular type of functions. These pointers, once initialized can be used to call the function whose address they are pointing to. Declaring Function Pointer A function pointer can be declared in following way : <return type of...
13
4,262