The compilation was successful, why is the answer wrong?

Updated on technology 2024-04-04
5 answers
  1. Anonymous users2024-02-07

    Summary. If it is a cracked version or an official cracked version, there may be some operational failures.

    Why do compiler errors occur?

    When I was programming C++ in Visual Studio2019, he always had a jumper error, and it couldn't run, so I made it according to the book, and I couldn't find the reason.

    If it is a cracked version or an official cracked version, there may be some operational failures.

  2. Anonymous users2024-02-06

    a=sum;should be put in main.

    Move it to printf....the previous line.

  3. Anonymous users2024-02-05

    a=sum;This is an executable statement, and since it doesn't belong to any function, it will give an error, and you can move it to a pair of curly braces around the main function, such as before the printf statement.

  4. Anonymous users2024-02-04

    Programming errors are generally classified into the following types:

    1) Syntax error in the program source. This type of error is the easiest to detect. For example, a variable is used without being defined in C. The following is an example of a source program:

    void main( )

    Because the n2 variable is not defined before the printf statement is used, the program will have a syntax error when compiling the source program with the compiler.

    2) Warning error in the program source**. This type of error is not as easy to detect as in (1). The usual cases are:

    Arrays are out of bounds, or a variable is defined but referenced without initializing it, and so on. These can cause inexplicable errors in the program. These errors make it more difficult to debug the program.

    The following is an example of a source program:

    Procedure. 1. An example of an array out-of-bounds problem.

    void main( )

    Procedure. Second, a variable is defined, but it is used as an example without initializing it.

    void main( )

    The function of the program is to cycle the value of variable i from 0 to 100, find the sum of accumulations, and save the result in the variable sum. Since the variable sum is not zeroed out before entering the for loop (sum = 0), the program will run randomly depending on the C compiler and the computer operating system (Windows or Linux).

    Procedure. Errors in the first and second programs are warning errors. The C compiler does not check for out-of-bounds arrays in the program when compiling such programs, or for references that define a variable but are not initialized. This kind of error is more difficult for users to debug.

    As for how long it takes to be able to debug all the source programs you have written, this varies from person to person. People with rich programming experience will spend less time. Conversely, it will take longer to debug the program.

  5. Anonymous users2024-02-03

    Actually, your problem can be summarized as how to check for bugs:

    1. Troubleshooting process.

    The process of solving bugs can be painful, tiring, uncomfortable, stressful, or even temporarily unsolvable, depending on whether you are doing your best. If you want to improve yourself and reach a higher level, you must cross this hurdle, otherwise you can only be a mediocre programmer who can only take on some simple tasks.

    The process of solving bugs can also learn a lot of things, but also a lot of fun, you can also get a lot of improvement, solving bugs is within the scope of your own responsibility, is a kind of fun or a burden, the key depends on the personal mentality.

    Finally, I would like to share with you a very famous saying called "the peak is high and there is no smooth road", which means: if you want to climb the highest peak to enjoy the beautiful scenery, there is no smooth road to walk, there are cliffs, and if you want to climb the peak to enjoy the beautiful scenery, you must cross these hurdles.

Related questions
6 answers2024-04-04

The competition for survival is not advancing or retreating, and the development of science and technology has a negative side, but human beings have to survive in the harsh natural environment, and compete with many beasts for living space, and science and technology are the most powerful human beings. >>>More

16 answers2024-04-04

Dear landlord.

Glad to analyze for you. >>>More

14 answers2024-04-04

In daily life, we all like to succeed, no one likes the word failure, and it is somewhat funny that we all seem to watch others succeed and then fail ourselves. It seems that other people's success is predestined by God, and their own failure is also doomed from the beginning. In fact, it is wrong to look at things this way, we always see the glamorous side of others, but we never know how much hard work they have suffered behind them, how many sins they have suffered, no one's success is doomed, they are all step by step, and then I will talk about what conditions are required for success. >>>More

18 answers2024-04-04

Yes, because he cared very much for each of his sons, and left them a certain amount of wealth.

17 answers2024-04-04

I think that successful family education, he focuses more on the shaping of children's three views, that is, children's values, what things the child thinks are important, what things he should grasp, what kind of attitude she should have towards her current life, these are the most important things. Family education should focus on morality, focus on concepts, rather than focusing on specific knowledge, specific support, there are schools to teach children, as long as the three views are correct, there is a good attitude towards learning, the school can complete the education of children's knowledge, and is fully capable of doing this well, the family should let the child establish a good three views, so that he can find a good direction.