C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views
For a given problem, there maybe many solutions, but we always look for a ‘better’ solution. So, how do we determine which solution is ‘better’? In the context of algorithms and programs, we consider a solution as ‘better’ when it uses the minimum resources. Hence, an efficient program will always...
0
3,529
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...
3
5,002
Algorithms are the riches of any programming language. The major objective of any algorithm is being efficient and optimized. For any logical scenarios, the prime and foremost is designing an algorithm. In this article, we shall we be discussing one such scenario to determine the k-th maximum /...
0
3,311
The Need Most of our articles over here are focused on Linux programming. However, many of us, especially beginners are still comfortable and much used to Windows environment, the look and feel of it. And also,many out of them tend to avoid Linux programming because of the pain of installing...
0
9,532
/*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
153
399,184
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...
0
5,084
During C programming, file operations are pretty common. And when you are writing programs in C on Linux, two familiar terms related to file operations are File Pointers and File Descriptors. We know both are different, but what are they? This article will focus on understanding what are file...
0
3,974
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...
6
32,895
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...
11
6,043
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,708
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...
4
5,114
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...
42
25,735
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...
7
4,980
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...
3
5,101
C implementation of double linked list #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define N 100 struct dlinklist {
3
48,530
Queue implementation using linked list #include <stdio.h> #include <conio.h> #include <stdlib.h> /***** Structure template *****/ struct list{ char data; struct list *next; };
11
80,820
In this tutorial, we'll be looking at the code structure of the 'echo' utility and will try to understand how it works, for those who are unfamilliar with the 'echo' utility, its one of the most basic and most useful utilities in a shell it prints out its arguments on the standard output, if you...
0
2,289
In this article we will extend our code to print more comprehensive information about a file/directory in a directory. Please Refer Developing Linux Utility like 'ls' in C Developing Linux Utility - Part II Arranging Output in Alphabetical Order Example $ ls -l total 148 ...
1
2,338
In this article I'm going to show you how to change value of variable during run time. There are many tools around how to do this easily, but I will focus on the way doing it programatically, specifically using C language. Tools I will use: Cheat Engine 6.0 Here is a simple code for login, I...
7
8,973
Many of us know that both C and C++ do padding when allocating memory for structure. But only few know that why the complier does it. In short, for the efficient access of the memory for OS, padding is required. In long words, the instruction can be fetched/written one machine word at a time....
8
19,372