About Run-Time Check Failure # 2 -. Stack around the variable 'XXX' was corrupted wrong solution

About Run-Time Check Failure # 2 -. Stack around the variable 'XXX' was corrupted wrong solution

I appear today in the clincher piece of code to run when an error, as follows:
. The Run-Time the Check Failure # 2 - Stack around at The variable 'filename' WAS corrupted
Here Insert Picture Description
probably means that (my English course, hence the saying translated)
runtime check failure # 2 - around the variable "filename" stack is corrupted.

Internet looked at the statistics, I found this to be a problem filename variable cross-border access, such problems often seen in the array variable element, the next encounter such problems can find the error noted in this XXX variable is whether there is cross-border access problem
(I have here is the filename array of characters there is a problem, I go in this array of characters entered exceeds the scope of this array, it had access violation, and the compiler will not show the problem, only to run the code after the run, or will be issued a warning)
Here Insert Picture Description
my solution is to redefine the scope of a larger array.

Thanks to the Internet bigwigs answers

Released five original articles · won praise 0 · Views 96

Guess you like

Origin blog.csdn.net/weixin_45784666/article/details/103605313
Recommended