ホーム » VC » std::vector のコピーで実行時エラー

2020年11月
1234567
891011121314
15161718192021
22232425262728
2930  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,516 アクセス



std::vector のコピーで実行時エラー

std::vector のデータ vf3a をコピーしようとして実行時エラー.

---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: c:\Temp\Test\T_gonsa\T_cmb_f\debug.080\T_cmb_f.exe
File: c:\program files (x86)\microsoft visual studio 8\vc\include\vector
Line: 741
Expression: vector subscript out of range
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
中止(A)   再試行(R)   無視(I)   
---------------------------

原因は vf3a のサイズが 0 .
std::vector のサイズが 0 で実行時エラー
vf3a.size() が 0 より大きい時のみコピーする様に変更しなければならない.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。