C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views
Program tells you the day of the date inputed. Remember when you copy the code paste in a file named *.c and not cpp file as that will cause an error. I have commented in the code where it will cause the error. #include<stdio.h> #include<conio.h> #include<time.h> #define AND && #define OR...
2
4,565
What is Dameon Process? A Daemon process is a process which is not associated with any terminal and hence is supposed to run in background. Since, a daemon process involves background processing, it is recommended it should not include any user interaction. Therefore, it should be clear about...
3
11,713
This time I want to speak on the 'printf' function. Everybody has heard of software vulnerabilities and that functions like 'printf' are outlaw. But it's one thing to know that you'd better not use these functions, and quite the other to understand why. In this article, I will describe two classic...
4
5,597
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...
1
10,270
This article is the Part-II (Part-I here) of the series where in we are focusing on good coding practices. In the Part-I we discussed the importance of the assert macro/function for detecting and debugging bugs in program. In this part we will focus on good coding practices while dealing with...
2
2,625
What is OpenGL? OpenGL is a set of standard API's for developing 2D and 3D graphics applications. The standard provides it in the form of a library which can be linked along wih your program (could be C/C++). OpenGL includes vast scope of API's which can be used to render figures, textures,...
2
9,140
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...
0
2,070
I have been writing many articles on C/Linux explaining concepts, APIs and their usage etc. This time I thought to write on a fundamental concept that every newbie should be well aware of in order to become a good coder, ie 'Good coding practices'. I have 3-4 broader level points to make here. I'll...
0
3,047
There are certain situations where you may want to limit your process's use of system resources like CPU or may want to put certain limitations on things like number of open file descriptors, maximum memory your process can allocate for its data etc. You may use commands like ulimit, sysconf etc to...
2
7,901
The article discusses about all the number formats viz Binary, Decimal, Octal, Hex and BCD (Binary coded decimal) and conversion from Decimal to Binary, Octal and Hex and also the reverse conversion. Binary A numbering system based on 2 in which 0 and 1 are the only available digits. ...
28
70,767
Recently I have been writing a lot on Linux files and functions related to file I/O. So, extending the discussion further in this article lets discuss two more important Linux functions : A) access(const char *pathname, int mode) This function checks whether the calling process can access...
0
2,317
Type casting is an explicit type conversion requested by the programmer to achieve its objective in the program. During any kind of computations involving various data variables of different data types, leads to the need of typecasting. Syntax used: (Data-type-2)<variable/expression of data...
0
1,892
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 : ...
0
1,985
Most of the people working on Linux must have used the basic command 'ls'. I use it many times a day. It is a very useful command when it comes to displaying the contents of a directory and their properties. For those few who have still not used 'ls' its high time now, go to its man page, study it...
0
3,375
A running instance of a program executable is known as a Process. A process when run can do various things like open some files, read/write some data, create some threads/processes, register some functions as callback in various scenarios etc. According to the logic, after the completion of the...
8
3,828
Introduction After a long hiatus, I am back. Months without programming and then finally I got some time on my hands. So I set out to code the Huffman's Data Compression Algorithm. And the result is here! :D The code is well-commented and I hav given some additional documentation. Also, I...
15
34,352
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...
6
4,046
After writing Why main() should not have void as return type? article the other day, suddenly one more question came up into my mind about the signature of main() function. In the earlier article I discussed about why 'void main()' should not be used when ANSI C expects the function main() to...
1
2,636
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...
0
1,903
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...
8
15,910