C language to achieve a simple student management system

It took a month to learn linked list, file and multi file programming, and then began to write the student management system. The relatively simple one realized the functions of adding, adding, changing, checking, various sorting, limiting the time of input and score analysis. I have encountered many problems and tried to solve them. Here are some points to pay attention to in the student management system, hoping to help others.

1. Be sure to write the framework of the main function first, and then add something to it. This is a little general. I put my main function below, which can be used for reference. My main function is an infinite loop of while (1), in which a switch is selected. Use a menu function to make its return value as the value selected by switch, and then enter different function main functions. The routines of other function main functions are the same as those of the main functions.

2. The input module must pay attention to the input format. The tail interpolation method I use allows the user to determine whether to continue input after each node is processed. In terms of format control, when the user inputs once, I will determine whether the symbol is standard. If it is not standard, I will input it again. Finally, it is stored in the file.

3. Make sure that the utilization rate of function writing is higher, so as to reduce the repeated writing of code. This is all based on my own style of writing code. I haven't done very well in this. In reflection, when I first started learning C, some people said that the main body of C language is a function and didn't understand it. After writing this, I feel that I'm really right. After the function of C language is written, It is convenient to directly quote when it should be used.

Complete code

Main function

main. c

Function declaration

student. h

Function definition

student. c

summary

That's what I want to say. Ha, I've been busy for a month, and I've used everything I learned. As long as the linked list and files will be available, it's very simple to write a simple student management system. I hope it will help you, and I also want to learn new things. If there are problems, you are welcome to point out that there are still many functions I haven't written, such as multi terminal login, graphical interface, etc, There is a big gap with others.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>