討論串[問題] 使用vector的push_back出現glibc錯誤訊息
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者tinlans ( )時間16年前 (2009/12/22 21:43), 編輯資訊
0
0
1
內容預覽:
所以 STL 的書才會告訴你 iterator 會在 vector 做 push_back 後失效,. 因為當 vector 的 capacity 不足且無法延伸出更大的連續空間時,. vector 就需要來個大搬家。. 不過你前一篇貼出的 code 怎麼看都沒有出現你這篇描述的問題。pos = f
(還有326個字)

推噓0(0推 0噓 2→)留言2則,0人參與, 最新作者gppo (香蕉是什麼?)時間16年前 (2009/12/22 18:53), 編輯資訊
0
0
0
內容預覽:
找到錯誤的原因了. 寫了一段簡短的code做說明. #include <cstdlib>. #include <iostream>. #include <vector.h>. using namespace std;. class TypeA. {. public:. TypeA( ) {cout
(還有704個字)

推噓0(0推 0噓 23→)留言23則,0人參與, 最新作者gppo (香蕉是什麼?)時間16年前 (2009/12/20 17:53), 編輯資訊
0
0
0
內容預覽:
我自訂了一class 叫做TypeA. 示意如下. class TypeA. {. public:. TypeA(){};. ~TypeA(){};. TypeA* pre;. vector<int> cells;. };. void functionA(...). {. if(c->pre!=&R
(還有883個字)
首頁
上一頁
1
下一頁
尾頁