本文整理汇总了C++中AList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ AList::clear方法的具体用法?C++ AList::clear怎么用?C++ AList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AList
的用法示例。
在下文中一共展示了AList::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
cout << "Starting ListTest" << endl;
fstream successfile;
AList AL;
// LList LL = new LList();
test(AL);
// test(LL);
AL.clear();
//LL.clear();
testAppend(AL);
// testAppend(LL);
if (SUCCESS) {
successfile.open("success", ios::out);
if (!successfile) {
cout << "Unable to open SUCCESS file :";
exit(-1);
}
successfile << "Success";
}
if (testsize == 0) {
exit(-1);
return 0;
}
/*
println("Do the timing test");
LList LT = new LList();
time1 = millis();
for (int i = 0; i < testsize; i++) {
LL.insert(10);
LL.insert(15);
LL.insert(20);
LL.insert(25);
LL.clear();
}
time2 = millis();
long totaltime = (time2-time1);
println("Timing test on " + testsize + " iterations: " + totaltime);
time1 = millis();
for (int i = 0; i < testsize; i++) {
Link temp = new Link(null, null);
temp = new Link(null, null);
temp = new Link(null, null);
temp = new Link(null, null);
temp = new Link(null, null);
}
time2 = millis();
totaltime = (time2-time1);
println("Timing test2 on " + testsize + " iterations: " + totaltime);
*/
exit(-1);
return 0;
} //end main
示例2: process
void process(type t){
AList<type> alist;
type data;
int size;
cin >> size;
for(int i=0; i<size; i++){
cin >> data;
alist.append(data);
}
alist.traverse();
alist.insert(1,100);
alist.traverse();
alist.remove(6);
alist.traverse();
alist.append(88);
alist.traverse();
alist.append(90);
alist.traverse();
alist.clear();
alist.traverse();
}