C ++ Runtime appears "what (): std :: bad_alloc" solution

Note: This is just my code this happens and the corresponding solutions, your code may not like me situation. Left this essay is for reference only.

Run the program appear the following results:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Process returned 3 (0x3)   execution time : 5.837 s
Press any key to continue.

It is then found inside the for loop, should be written as

for (int j = 1; j <= 3; j ++)

Place, written

for (int j = 1; j <= 3; j --)

Change overnight just fine.

Guess you like

Origin www.cnblogs.com/zifeiy/p/10958930.html