C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
Comma-separated expressions were inherited from C. It's likely that you use such expressions in for- and while-loops rather often. Yet, the language rules in this regard are far from being intuitive. First, let's see what a comma separated expression is. An expression may consist of one or...
Introduction In C you can effectively change the value of the constant variable. Just compile the following program and you will see the output. void main() { int const i=123; int *ip;
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....
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++,...
What are Hash Tables? Hash table is a data structure to store key value pairs for all situations. So it is like a table with each entry has a key and a value corresponding to it. So, it is an efficient way of mapping and accessing data. An abstract illustration of hash table: -> Data...
I am doing C programming from a couple of years ago and finally I convinced myself and grabbed all my guts to write an article on Pointers. Now, one could easily question Why? Basically, Pointers are the most useful part of C and usually the most difficult to understand. Note: I don't want to...
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...
Linked Lists Implementation ... #include<stdio.h> #include<conio.h> #include<malloc.h> void insertafter(struct node ** ,int ,int); void insertatbeg(struct node ** ,int ); void add(struct node ** ,int); void search(struct node **,int);
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...
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?...
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,...
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...
What is a socket? See there are many types of sockets hardware sockets “like electrical sockets” etc. and software “programming sockets” like what i'm going to talk about from now onwards. See , a socket can be thought like any standard way to perform network communication through our system...
Using URLDownloadToFile function In this article I would want to show you how to download a file from internet using URLDownloadToFile function in C language. I think everybody has ever experienced the downloading a file with Internet Explorer. IE is using directly this function, but It uses...
The other day I was working on a code where in I was doing some file related operations. I used the function feof() to test whether the end of file has been reached or not. I got into some trouble over the way I used this function in my code, after debugging a bit I found the problem. The problem...
Introduction This artcile talks about Design By Contract Technique with an example to show how it can be used in an Application. Background Most application problems arise because of inappropriate handling of data obtained from external systems that could be a application user, remote...
Today while solving a problem, I had to convert integers to string in C to use its indexing capabilities. One simple solution was to use sprintf, which can be done in 2-3 lines, but i was temped to solve this problem without any string manipulation functions. The Code // Change a positive...
Introduction This article talks about different ways of handling Abnormal Condtions or Errors that occur or Invalid Data receiving by an Application. These Errors are something, the programmer expect to occur in their Applications. Depending on the specific circumstances, below are some...
In a language like 'C', the programmer has almost complete control over memory operations but this brings in a problem that many of you might have faced : Memory errors. Although GDB can be used in many areas of these kind of problems but there are sometimes when programmer doesn't want to put too...
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...