In this article, we will discuss the following main topics. I encourage you to watch YouTube video to understand the source code in detail.
- Technique to switch players.
- Logic to check winner player.
- Calculate computer player best move.
Download Mini project in c,c++,c# ,OpenGL,GLUT,GLFW,windows form application source code
In this article, we will discuss the following main topics. I encourage you to watch YouTube video to understand the source code in detail.
In this section, we will discuss the following items.
In this part, we will create pagination in C programming to view large set of books data. In college there might be thousands of books. We can't display all items on the screen, so we need to create techniques to display small set of data at a time and allow users to select next page or previous page to view data which is called pagination. Also, we will discuss to manage large set of books data and write books data into CSV file.
Here, we will discuss following items:
In this part, we will learn the techniques to implement a username and password login system and manage user accounts.
When a user runs the application for the first time in admin mode, the application requests the user to create an admin account. However, from the second run onwards, the user has to log in using their account details. After logging into admin mode, the user can add or modify multiple admin accounts. To identify the application’s first run, it will check if the admin account file exists in the system. If the file doesn’t exist, then the application calls the create account function. Otherwise, if the file exists, it will call the Admin login function.
int checkFirstLogin(){
int flag=1;
fa = fopen(DATA_FILE,"rb");
if(fa!= NULL){
flag= 0;
}
fclose(fa);
return flag;
}
In this application we have two scenarios where we read CSV files. First to read Students data and second to read books data. Students need to provide student id to login application. We read the students data from csv file and compare the student id. Also, we read large set of books data from csv file.
Sample student csv data:
The header file loadCsvData.h is written to load csv files student data and books data. There are four main functions which reads the files.
static int getStudentID(char stuId[MAX_ID], struct stuProfile *st);
static int loadStuValues(char *line, char *sFields[STU_COL_NUM]);
int readBooks();
static int loadBookValues(char *line, char *lFields[BK_COL_NUM]);
int getRowCount(FILE *fpl);