一个关于c++链表类的使用问题

来源:百度知道 编辑:UC知道 时间:2024/05/03 02:38:39
请各位高人指点一下这段程序错在哪里?
#include "iostream.h"
#include "List.h"
using namespace std;

void main()
{
list<char> chlist;
for(int i=0;i<10;i++)
{
chlist.push_front(i+65);
}
list<char>::iterator theiterator;
for(theiterator=chlist.begin();theiterator!=chlist.end();theiterator++)
cout<<*theiterator;

}
感激!!!

没错,只是不规范

==============================
#include <iostream>
#include <List>
using namespace std;

int main()
{
list<char> chlist;
for(int i=0;i<10;i++)
{
chlist.push_front(i+65);
}

list<char>::iterator theiterator;

for(theiterator=chlist.begin();theiterator!=chlist.end();theiterator++)
{
cout<<*theiterator;
}

return 0;
}