摘要: #include <iostream> #include <algorithm> using namespace std; struct abc { int begin,end,length; //own struct }; abc a[100]; //s... 阅读全文
posted @ 2012-02-11 15:42 C4ISR 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 1: #include <iostream> 2: #include <vector> 3: 4: using namespace std; 5: 6: vector <int >a(1);//vector<struct>name(size) 7: int main() 8: { ... 阅读全文
posted @ 2012-02-11 13:06 C4ISR 阅读(318) 评论(1) 推荐(0) 编辑
摘要: Vector vector是C++中用来取代C数组的。vector解决了传统C语言数组的许多问题。vector能查询当前数组大小以及动态调整大小。用 vector<类型> 可以声明vector,其中类型是存储在vector中的变量类型。比如如果您想创建一个包含int的vector,可以使用: vector myVar;新创建的vector大小为0。声明一个其它大小的vector,您可以使用... 阅读全文
posted @ 2012-02-11 12:53 C4ISR 阅读(307) 评论(0) 推荐(0) 编辑
C4ISR