Mini Project Student Record System in C

Mini project student record system is another project based on programming language C. It also uses files as a database. This project is similar to another mini project of this blog but every project in Programming Techniques has a unique style of coding and presentation so that reader gets clear about all aspects of programming. In this project, a console window is virtually split into two parts, one is static which doesn’t change and another is dynamic which changes time to time. The text is written using various colors to make them static.

The program is not complete, the reader can download the code and make improvement and also make it complete. There are many places for further enhancement. I think this project becomes a milestone for your study of C programming and making project using C.

Here is the source code in C for the project. As the project is built using windows.h, it only works on Windows machine. For UNIX/Linux user, please come back as I am writing code for it. The code is also available on GitHub.

#include 
#include 
#include 
#include 
#include 
 
struct student{
    char ID[15];
    char name[20];
    char add[20];
    char parname[20];
    int Class;
    long unsigned int phone_no;
};
 
struct student stu;
 
///This will set the forground color for printing in a console window.
void SetColor(int ForgC)
{
     WORD wColor;
     ///We will need this handle to get the current background attribute
     HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
     CONSOLE_SCREEN_BUFFER_INFO csbi;
 
     ///We use csbi for the wAttributes word.
     if(GetConsoleScreenBufferInfo(hStdOut, &csbi))
     {
        ///Mask out all but the background attribute, and add in the forgournd color
          wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);
          SetConsoleTextAttribute(hStdOut, wColor);
     }
     return;
}
 
void ClearConsoleToColors(int ForgC, int BackC)
{
     WORD wColor = ((BackC & 0x0F)  0; i--){
        gotoxy(i,25);
        if(i == 35){
            printf("%c",202);
        }else{
            printf("%c",205);
        }
    }
    gotoxy(0,25);
    printf("%c",200);
    for(i = 24; i > 0; i--){
        gotoxy(0,i);
        if(i == 6){
            printf("%c",204);
        }else{
            printf("%c",186);
        }
    }
 
    for(i = 1; i 

Here is the output of the program:-

Loading...

 

Loading...