You are here

C project development tutorial

C project development tutorial: This tutorial is for all those who wish to make their own project in C programming language. Let me tell that you need not be an expert in programming to make your own project, if you are a beginner/student then you can make one yourself. Fundamental concepts of C will be required to make a project; also don't worry if you don't know pointers if you know then its good, pointers are used rarely as it depends only on you whether you want to use them or not. But you should know how to make your own functions and use them. To make a project you may have to use graphics in your program, so if you want to learn C graphics programming then learn them at C graphics programming tutorial. Following points will be useful to manage your project.

1) Be very clear about the idea of your project, modifying your project at a later time can be a trouble.

2) Always create a back up of your source code, you start your project by writing some portion and it works fine but at a later point in time you need to modify it so you modified the original one and you find it's not working and now you want your original one back but it is not possible if you have saved your file or you can undo if it works. So you should keep a backup of every source file.

3) To easily manage your project write code in different files.

4) Do not use too many global variables as global variables are shared by all the functions so they get modified causing a lot of trouble when you’re not getting the result what you desire although your logic is correct.

5) Use const keyword as much as you can, it will help you to prevent variables from being modified when not required.

6) Ensure that every function is performing the task for which it is made, you can test a function separately by using it in a program which is not a part of your project.

7) Every function must have a description of what it does and details of the arguments being passed to it. You can write comments to achieve this.

8) Write detailed comments in your source code whenever possible particularly when you are using a trick. It will help you quickly understand source code at a later time.

9) Initialize every variable at declaration time.

10) Use Tab and blank spaces to make your code easily readable. For example, consider the following sample program:

#include <stdio.h>
 
int main() {
  int b = 1, c = 1;
 
  for (b = 1 ; b <= 10 ; b++) {
    for (c = 1 ; c <= 10 ; c++) {
      printf("%d\n", b*c);
    }
  }
 
  return 0;
}

This program is easily readable than the below one.

#include<stdio.h>
int main()
{
int b=1,c=1;
for(b=1;b<=10;b++)
{
for(c=1;c<=10;c++)
{
printf("%d\n",b*c);
}	
}	
return 0;
}

These tips will help you to easily manage your project, these are not complete and some projects can't be developed by following all these for example when the requirement of a user is not clear then you need to use modify your project frequently.