codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  What`s the reason for these errors in c++ STL  vivekc++ at 14:36 on Wednesday, February 11, 2009
 

#include<iostream>
#include<list>

using namespace std;

int main()
{
list<int> dob;

for(int i=0;i<5;i++)
{
dob.push_back(i);
}


for(int i=0,list<int>::iterator itr=dob.begin();i<3;itr++,i++)
cout<<*itr;

return 0;
}


errors--

test.cpp: In function `int main ()':
test.cpp:17: `iterator' specified as declarator-id
test.cpp:17: extraneous `int' ignored
test.cpp:17: `int list<int, allocator<int> >::iterator' is not a static
member of `class list<int, allocator<int> >'
test.cpp:17: parse error before `='
test.cpp:17: `itr' undeclared (first use this function)
test.cpp:17: (Each undeclared identifier is reported only once for each
function it appears in.)










CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  2D Vector Memory Problems
•  Re: plz help me answer if u can
•  What`s the reason for these errors in c++ STL
•  superimposing asp.net fields on flash animation (swf)
•  how to make a shopping list?
•  Re: parser project needs perl programmer
•  SFTP applets
•  New to Bento4
•  Submit multiple forms with one button


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009