本文整理匯總了C++中TList::Push方法的典型用法代碼示例。如果您正苦於以下問題:C++ TList::Push方法的具體用法?C++ TList::Push怎麽用?C++ TList::Push使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TList
的用法示例。
在下文中一共展示了TList::Push方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: main
int main() {
TList *list = new TList();
printf_s("list.First() = %s\n", list->First());
printf_s("list.Pop() = %s\n", list->Pop());
list->Push("Hola");
printf_s("Pushed \"Hola\"!\n");
list->Push("Holita");
printf_s("Pushed \"Holita\"!\n");
list->Push("Que tal?");
printf_s("Pushed \"Que tal?\"!\n");
printf_s("list.Next() = %s\n", list->Next());
printf_s("list.Next() = %s\n", list->Next());
printf_s("list.Next() = %s\n", list->Next());
printf_s("list.Next() = %s\n", list->Next());
printf_s("list.First() = %s\n", list->First());
printf_s("list.Pop() = %s\n", list->Pop());
printf_s("list.First() = %s\n", list->First());
list->Push("Hola");
list->Reset();
printf_s("list reset!\n");
printf_s("list.First() = %s\n", list->First());
printf_s("list.Next() = %s\n", list->Next());
delete list;
getchar();
}
示例2: GetReverseList
TList GetReverseList(TList lstSrc) {
TList copy;
const char * ptr;
if (lstSrc.Size() > 0) {
for (unsigned int l = 0; l < lstSrc.Size(); l++) {
for (unsigned int i = 0; i < lstSrc.Size() - 2; i++) {
lstSrc.Next();
}
ptr = lstSrc.Next();
copy.Push(ptr);
}
}
return copy;
}