C language is a process-oriented, and C ++ is an object-oriented
C and C ++ difference:
C is a structured language, it focuses on algorithms and data structures. Design of primary consideration is how the C program, the input (or ambient conditions) calculation processing performed by a process to obtain an output (or implementation (transaction) control).
C ++, the primary consideration is how to construct an object model, so that the model can fit the corresponding problem domain, so you can get the output or the implementation process (transaction) is controlled by the state acquiring object information. So the biggest difference between C and C ++ is that their ideas for solutions to the problem are not the same. The reason why C ++ is more advanced than C, because "design concept has been integrated into C ++."
And the language itself, in C more is the concept of the algorithm. It is not C is not important, wrong! Algorithm is the basis for program design, good design without a good algorithm, the same can not. Moreover, "C plus good design" can write a very good thing.
Xiao Bian recommend a language school C / C ++ learning skirt [767,865,598], whether you are big or small white cow, or would want to switch into the line can come together to learn to understand progress together! The inner skirt has development tools, a lot of dry goods and technical information to share!
Game brief
This game is like this: First, the system will generate some random numbers and symbols mixed operation, you need to find out what you think the correct title and calculate the results within in one second, then the system will compare your answers with the correct answer to make the score, the final score will show you.
After the introduction, I believe we already have a preliminary understanding of the game it! So how do we write the game in C language? Here let Xiaobian to introduce the program code of the game now!
First, we set the game window to display the game title "find the title game", mode set the game window to 48 lines 25, color set the game window on a blue background green characters, games and shows the date and time (date and TIME ), results are as follows:
Then, where the use of a for loop, the countdown by the digital display form 3,2,1, 1 second intervals. Clear the screen, include the use of loop 10 for the subject again.
Here random letters with rand, and is inserted between a number.
E rand and reuse previously defined string [4] = { '+', '-', '*', '/'} randomly generates a mathematical symbol.
Similarly, again using the random number rand letters, and insert a number between 1 second and a pause time as observed Reflections, clear screen.
Then the player enters his calculations, the system will be the player's answers and correct answers were compared, correct, let n from plus 1, or else did not.
After 10 topics answered, display the player's final score.
Xiao Bian recommend a language school C / C ++ learning skirt [767,865,598], whether you are big or small white cow, or would want to switch into the line can come together to learn to understand progress together! The inner skirt has development tools, a lot of dry goods and technical information to share!
We think this game is not very interesting? We can try it yourself using the C language to do some simple little game, I believe that soon you will find the C language little fun!