C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
The other day, I just had this thought of exhausting the R.A.M. of my ailing, old P.C. in the hopes that it may trigger off a cataclysmic crash which would render it useless :happy: (so that I finally get that brand new mega-system P.C. which I so yearn! :D ) So I set out to write this program...
3
3,217
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,205
Program to find max(x,y) or Min(x,y) without using any relational and logical operator. int maximum(int x, int y) { int fNum,temp,num; num = x; num = y; temp=fNum; return( temp);
4
3,197
Abstract Introduction PC-Lint tool VivaMP tool Static analysis implemented in Intel C++ compiler Conclusion References Abstract
4
3,096
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,085
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,043
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,037
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,034
Continuation of Shell-coding basics..I suggest a glance over it before you start reading this.. Testing We'll be using a simple C program to accomplish our task. test.c // #include<stdio.h> we will not be needing this as we are not using any functions from the C library...Just basic...
1
3,030
Program prints the month without using any system related information but just making some simple calculations of days from the reference day 1/1/1900 as Monday. #include<stdio.h> #include<conio.h> #define Y 1900 /*1/1/1900 Monday*/ void days(int ,int ); void display(int , int );...
0
2,964
Format strings are the strings mainly associated with printf's set of instructions (like printf,fprintf etc..) which basically stands for print format.... These functions accept several arguments and put them on the stack..and as a format specifier is noted in the string the function pops the data...
1
2,951
Introduction A lot of us use TC in our colleges. Today I will share with you Two ways to have fun in lab with your teachers. ;) Background Trick I In the first way, you will create an error in any wokring code just by adding one or more numeric letter in it. There will be only one...
3
2,939
Error handling has always been dominantly vital in programming. It has become a bit more sophisticated with the object oriented languages, however even in the system programming language like C, error handling is being offered in its own simple ways. Introduction To swim deep into the...
0
2,930
Pointer Pointer is a declared like a variable, but it's not an ordinary variable, it's a fancy variable, that can store address of the another variable. Pointer is very much useful for allocating memory at run time , that's dynamic allocation. Pointers are said to "point to" the variable whose...
5
2,902
This is the code I wrote in my college days and dont quote me on this if something does not go as expected. #include<stdio.h> #include<ctype.h> #include<conio.h> void main() { int c,i,letter;
8
2,898
Pretty sure, one must have used the datatype ‘float’ numerous number of times since the day one has started programming. However, there are many times, when we mishandle floats and doubles, or get unexpected results while using float variables or find ourselves being perplexed while using floating...
0
2,864
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,824
The below program calculates the largest no among the no entered but it just calculates as user inputs them. This can be used with files and as you move ahead in file you can store the max and the min value in a variable when parsing the file. #include<stdio.h> int largest(int,int); void...
5
2,805
In this article we'll be learning how we can improve our C code by using Macros instead of functions. How simple functions can be converted into macros to save on some CPU instructions. Some basic knowledge of C and a little bit Assembly is considered as pre-requisites. The Code We'll be...
0
2,751
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,679