Visual Studio Error

Source: Internet
Author: User
Tags clear screen switch case

Visual Studio Error Debug Error Error type #0表示调用约定错误

Consider adding _stdcall in front of the pointer. DLL library updated, EXE not updated will also report this error.

#2表示栈溢出

-S is the abbreviation for stack around the variable ... was corrupted

This error was encountered when assigning 12 floating-point numbers to an array of integers. Errors are generally exponential groups that are out of bounds.

Stack around the variable ... was corrupted means stack overflow.

As you can see, the array has a stack overflow when J is less than 12来. The reason is that I defined the array only 11 locations, if J reached 11 when Array[11] does not exist, but this situation is different from uninitialized variable because the in-memory array is simply a position with a fixed length, vs2015 will not detect whether the rear memory is within the array range. The result is a debug error#2 error.

#3表示使用了未初始化的变量

-T is the variable ... is being used without being initialized abbreviation

-T is the abbreviation for the variable ... is being used without being initialized. In switch case (or in other cases), when you forget the break, there will be an error. It was obvious that day=31 behind the break; English tip: The variable is being used without being defined (initialized) said that the variable is undefined, the meaning of initialization.

Switch-case in-memory operations are the same as If-else. But for Switch-case, the system performs a single minus loop until it is 0.

No way to log in when you install Visual Studio
    • 360 Back! 360 Back! 360 Back!
    • Restart your computer
    • Re-open the Setup program
    • The DNS modification is the main choice: 114.114.114.114 alternative: 8.8.8.8 (see 360DNS preferred)
Branch conditions are not covered, not all branches have return values

What do you mean, branch conditions are not covered? For example If-else, two choice one, certainly cover. For example If-else if, if two conditions are not satisfied, there is a third possibility, if this possibility does not return, it is considered not fully covered.

The system will have an empty else behind the default, but this else does not have a return value. So there was a C4715 error.

The project failed to load. Tip: The project requires user input manually.

Workaround:

Delete the original items and folders, create a new directory, the problem can be lifted

Unable to open ... To write

This is because the last time the operation was not closed, the last window closed, re-run it is no problem

The problem of HANDLE Hout

Why does the Gotoxy function not work?

In fact, handle is the type of handle, handle Hout in the main function is the new declaration of Hout, so hout for main () is a local variable. The principle of global variables is directly masked by local variables in the function, which is for local variables. The Gotoxy function calls a global variable, and the global variable is empty, so the Gotoxy function does not take effect.

Workaround:

According to the normal assignment method, so that the global variable hout is the normal assignment, you can see that the Gotoxy function has played a role at this time. This eliminates the hassle of adding all functions to the handle Hout parameter.

Warning Msb8028:the Intermediate Directory ...

This problem is not related to the code. The reason for this is that there are two duplicate project points to a directory.

Workaround:

Copy the required CPP and delete the item (even the folder is deleted) and then re-establish the project. Copy the CPP back (although it can not be copied, but in order to stabilize, it is recommended to put in the original folder.) Run again, the error disappears.

Fatal error C1301:error accessing program database D:\Document\CPP_subject\School_asignments\Sudoku\Release\7- B6.IPDB, invalid format, please delete and rebuild

Change the mode to x64, or delete the wrong file

Method of error Checking How do I tell if an array crosses?

Now deliberately made a mistake, let the maximum of 12 of the array loop to 30

The program crashes with error third, which indicates that the array is out of bounds. Where does it cross? Re-debug, but this time only press F5.

Debug program Alarm, below indicates the wrong location.

Click Break to see details.

The right side explicitly reported the number of errors, while the left side tells the exception location, even the memory address is provided. Obviously I becomes a random number, and the month array is out of bounds.

Explain that the debug mode will only report the program in which line of terminal, sometimes the cause of the error may exist in other locations, this time it is necessary to tidy up the idea of the program along the logical clues to look closely.

There is one more explanation. After the modification, if also reported the same error, it is possible that the last small black window was not closed

How does the function of the external file look wrong?

Follow the principles, return what, print what.

If all is 0, cannot be sure is that 0, add a few oneself know the number, can quickly distinguish which one is wrong.

Gotoxy function Invalid?

The Gotoxy function cannot be moved to the specified position anyway, but this line is actually executed, for what reason?

This line is actually executed because the Gotoxy function's target location exceeds the size of the console window, and this function fails and the system automatically resumes reading.

More cycles than expected cause confusion in display

Similar to an unpredictable error in console printing, printing is more chaotic than the boundary inverted wrap, and can be used _getch () + Print cycle times

A similar method can be used to print out the number of cycles and to know that the first cycle of errors occurred

That way, as you print each step, there will be a number of row and column loops similar to footnotes.

Test the application multiple times with different data

For the same program that requires multiple sets of different data to be tested, consider adding a clear screen and Goto (or while (!)) at the beginning and end of the program. Statement.

while(!){……}

System not clear

Enter system ("pause") somewhere, and all other cout will prompt cout ambiguous

Run the program at this time without prompting for any errors

But the error still exists.

Workaround:

Include #include<cstdlib> in header file

The problem has been solved

Originally normal console interface printing color appears typesetting confusion

The reason for the error is that the Chinese input method under the console interface interferes with the printing process.

Workaround:
    1. Press SHIFT (or other keys) to switch to the English input method before entering the official print results interface
    2. A blank line is reserved for the IME when planning the window, but not aesthetically pleasing

Have a free map

Visual Studio Error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.