Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Thoughts on C language programming

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The combination of C language course design and the practical application of modern computer technology is a good test of our ability in this aspect after we have finished the theoretical course at this stage, from the initial algorithm ideas to the beautiful graphical interface after running and debugging and the exciting available programs are all a good process of learning and training. It enables us to consolidate the original theoretical knowledge and cultivate our ability to flexibly use and combine and integrate the knowledge and skills we have learned to analyze and solve practical problems. It makes us realize the application and exertion of our knowledge and ability in practice. It can not only stimulate the sense of innovation, but also develop creative ability and communication ability. Although this internship lasts only one week, it really benefits me a lot. Through my internship, I have enriched my experience in computer operation, deepened my understanding of the C language, and become more familiar with its environment.

I learned about C language data types, constants and symbolic constants, variables, C language operators and expressions, assignment operators and expressions, self-increasing and self-subtracting operators, and comma expressions. I think the example stage should be a transitional stage. After the study of grammar in the previous stage, there may be many concepts that we are relatively vague, or many things are too abstract. This prepares us for instantiation in the second stage of learning. It can be said that the first stage is a class that we build for our learning. What should we do in it? In the second stage, that is, at this stage, we should materialize the things in the previous paragraph (instantiate the previously created class). How to specify, to put it bluntly, to practice some small examples? there are many examples of this in e-books downloaded from the Internet. if you go to the bookstore to buy books on your own, there should be a lot of examples. I typed the examples every time. Maybe some people will not type it by hand, such as copy, etc., of course, but I personally think that for beginners, it is better to type it by yourself. After all, these things are quite strange to us. If you type every word by yourself, it will be difficult for you not to remember some code. Here, we have to understand every example of practice. If you can modify some examples slightly, understand the essence of it, and let yourself know why you did it, it would be best. When I usually practice, this step is indispensable, and I am used to it, so it becomes a conditioned reflex. I don't want to do this. Finally, we should summarize the total, sort out the techniques used in the previous examples, and make a larger example, trying to apply all the knowledge we have known so far to it, just as far as possible. of course, some things can not be integrated together, but also the exclusion between the code.

Second, how to use the basic C language sentences learned in the last semester in airplane games (or other software)?

I have learned a lot about printf,scanf,if,else functions and so on, and summed up the following ways to use them:

1. Expression statement, empty statement, compound statement.

2, the input and output of data, the call of input and output function.

3. Compound sentence.

4. The use of GOTO statements and statement labels.

Third, the analysis of the structure of aircraft games (or other software).

Simple changes were made to the code according to the teacher's request.

1) the program uses functions to form a modular structure.

2) in the main function, first call the menu () function to generate the menu

3) then judge what the operation is by constantly receiving the user's keystrokes.

4) then set up the plane and move

5) display

# include

# include

# include

# include

# define N 35

Void print (int [] [N]); / / output function

Void movebul (int [] [N]); / / × × mobile function

Void movepla (int [] [N]); / / enemy aircraft movement function

Void setting (void); / / set function

Void menu (void); / / menu function

Void oper (void); / / Operation function

Int scr [22] [N] = {0}, pl=9,width=24,speed=3,density=30,score=0,death=0;// global variables: interface, our initial position, interface width, enemy plane speed, enemy plane density, score, death

Main (void)

{

Menu ()

Oper ()

}

Void oper ()

{

Int iMago Junior 0

Scr [21] [pl] = 1

Scr [0] [5] = 3

While (1)

{

If (kbhit ())

Switch (getch ()) / / controls moving left and right and entering the menu

{

Case 'a':case' Aids:

If (pl > 0)

Scr [21] [pl] = 0recom SCR [21] [--pl] = 1

Break

Case 'd':case' Downs:

If (pl

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report