C Programming Tutorials

C Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
How to make your program to be fast. 1. Use Pre Increment or Pre Decrement in place of Post Increment or Post Decrement operator. i.e. use ++i or --i in place of i++ or i--. Because ++i operator take increment and save it i.e. One CPU Instruction is required for it. and in case of i++...
14
4,793
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...
5
4,689
I am attaching a ZIP file that contains a Quiz Making and Participating program. You MUST donwload the ZIP and run the exe. The source code given below would not be sufficient enough. As of Right now, only the participating side is completed - Files are created for individual teams and all their...
4
4,684
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...
3
4,669
Continuing my previous article Understanding File Handling Functions in C, here in this article let us focus on functions like : fread() // read a chunk of data from file fwrite() // Write a chunk of data to file feof() // Check for end of file indicator ferror() // Check for error...
0
4,658
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,626
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...
4
4,556
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; ...
2
4,484
Function pointers are pointers that can hold the address of a particular type of functions. These pointers, once initialized can be used to call the function whose address they are pointing to. Declaring Function Pointer A function pointer can be declared in following way : <return type of...
13
4,374
Networking is all about transmitting messages from one node to another. The simplest example can be to transmit "Hello World" from one computer to another. Socket programming in C/C++ has already been covered. Today we will see how to check if the transmitted data has any errors. There are many...
1
4,325
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
4,217
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,180
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...
8
4,150
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) {...
1
4,150
Abstract Introduction size_t type ptrdiff_t type Portability of size_t and ptrdiff_t Safety of ptrdiff_t and size_t types in address arithmetic Performance of code using ptrdiff_t and size_t Code refactoring with the purpose of moving to ptrdiff_t and size_t References
4
4,139
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...
1
4,132
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");
2
4,087
After writing my previous article Virus Code in Linux - C Code That Changes it's Process Name Run Time, I wondered if a process can change its name then why cannot it change its PID. And what if a process can change both its name and PID after lets say every 1 second? Well it will be a difficult...
0
4,066
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,974
Stack is a Last in First out(LIFO) abstract data structure...Stack is used as the main data structure for processing and data management on most of the OS architectures...like intel x86 etc etc.. Stack based Overflows It happens when to much data is passed on the call stack and results in...
4
3,920