originally published at 抓~ 抓到一隻瞌睡蟲
其實是在說下面這段程式…
1 #include <list>在某台跑的結果是
2 #include <iostream>
3 using namespace std;
4 int main()
5 {
6 list<int> a;
7 a.pop_front();
8 a.pop_front();
9 a.pop_front();
10 a.pop_front();
11 a.pop_front();
12 a.pop_front();
13 a.pop_front();
14 a.pop_front();
15 cout <<a.size()<<endl;
16 return 0;
17 }
alex@xxxxxx [17:33] ~> ./a.out結果另外一台是
a.out in free(): error: malloc() has never been called
Abort
yhsung@oooo [5:20pm] ~> ./a.out另外試很多台, 看起來應該是要crash吧? @_@
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
0
c++ programming STL
沒有留言:
張貼留言