Why this cause my program to finish with following exit code
deque<int> di((istream_iterator<int>(cin)), (istream_iterator<int>()));
copy(di.begin(), di.end(), ostream_iterator<int>(cout, " "));
The thread 0x5d4 has exited with code -1073741749 (0xc000004b).
The program '[3776] Josuttis.exe' has exited with code -1073741510 (0xc000013a).
EDIT:
This error i have during program execution:
Actually, enter "1 1 1 1 9 Ctrl+C". May be Ctrl+C is wrong here?
EDIT2: Ouch, i think it is because of Ctrl+C - CTRL+C (Break), Sorry for bothering you!
Just because your program crashed on a particular line doesn't mean that's where the bug is. Although the cited code fragment is slightly ...odd, technically I see nothing wrong with it.
The bug could've occured anywhere else, previously, where memory got corrupted, which eventually results in a crash at this particular point.
See https://stackoverflow.com/help/mcve for some helpful tips regarding how you can track down the real problem.
Welcome to C++.
User contributions licensed under CC BY-SA 3.0