C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
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...
As it is said, great things are in small ones. Its someway true in C as well. Working on bits rather than bytes, and other bigger data structures leverage implementations in speed and space efficiency. With really high end computers coming up these days, bitwise operations may not be that useful in...
The thing is that it wonít be really OOP because the encapsulation will be a bit weak and you will have to handle constructors and destructors manually but itís still cool. First of all, basic knowledge: 1) Structures 2) Pointers to Functions 1: Structures A structure is a collection...
Introduction Here I am going to give a simple example of addition, substraction, multiplication etc to check overflow/underflow so that we can minimize buggs/defects in our code The code In your project/product or any place, If you have some operation like Addition, substraction...
What is C ? C Programming Language was developed at AT & T’s Bell Labs in 1972. It was designed and developed by Denis Ritchie. Spite of C being an old language it still has remained one of the worlds most popular and one of the best programming language even came into existence! C is...
I've arrived at the source code of a widely know instant messenger Miranda IM. Together with various plugins, this is a rather large project whose size is about 950 thousand code lines in C and C++. And like any other considerable project with a long development history, it has rather many errors...
Signals are the interrupts. They are a way of providing asynchronous events. For example a user typing ctrl-c on terminal to stop a program. Most of the programs need to handle signals. Every signal has a name like SIGxxx. For example : SIGALRM is the alarm signal that is generated when the timer...
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...
The keyword ‘static’ has been widely used in many programming languages. I know it is there in Java, C and C++. I am pretty sure, it is must be used in other languages as well, even though it might depict different attributes and characteristics. However, we are going to learn about the keyword...
One of the tricky question in interview comes out is How do you point to the third byte of an integer. Assumption that integer is 4 byte. Here is the code to do the same #include <iostream> using namespace std; int main(int argc, char *argv) { int i = 35; //integer...
Strings are paramount datatype for any real use case scenario. However, in C, there is no basic datatype as ‘string’. A string is understood as a collection set of characters i.e. in programmatic language, an array of characters, which are: Directly assigned in double quotes Terminated by a...
Hello every member of go4expert forum. I have something to share with you all. I have successfully developed a date program which prompt a user to enter a date(12/12/2005) and return the day of week(tuesday). #ifndef CONVERTER_H_ #define CONVERTER_H_ struct U_Days { int days; }u_days; ...
Hello to one & all, I did a little bit of programming this weekend (I got myself a new Xbox 360!) .... but not satisfied with the Gaming monolith, I decided to do some game programming myself. So, I implemented that very famous game played by everyone who had access to a computer in the early 90's...
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...
This is the second article on avoiding certain errors at the early stage of code writing. In the previous post, we have already advised you to avoid a large number of calculations in one expression. However, we should investigate this question in detail. Let's see what's dangerous about complex...
When an ELF executable is executed, a process is created and its process image is create in the RAM. However, it is here in the process image in RAM, all the variables are assigned memory. Sometimes memory is allocated statically i.e. defined how much memory at the compile time, and at times it has...
List of helpful C tools that will help you peek inside a process or an a.out file. Some are specific to Sun OS. I have compiled it into an easy-to-read summary of what each one does, and where to find them. Going through the man pages for each, and try running each on a couple of different a.outís...
Stack memory Let's suppose there is nothing on the stack to begin with. One of the functions either the calling function or the called function depending on the calling convention would start a stack. Lets take a very simple C / C++ program to see how things would work. int func(int i) {...
The code to find upper and lower diagonal of 3x3 matrices #include<conio.h> #include<stdio.h> void main() { int a,i,j,k; clrscr(); printf("\n Enter a Matrix 3x3:\n\n");
Introduction The aim of this article is to explain the upcasting. Before going through this article I expect people have some preliminary idea about inheritance mechanism. Background The term upcasting comes from the class inheritance diagram. In the class inheritance diagram we...