Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > copy(..., ostream_iterator<int>(cout, " ")) cannot compile, why?

Reply
Thread Tools

copy(..., ostream_iterator<int>(cout, " ")) cannot compile, why?

 
 
Scofield
Guest
Posts: n/a
 
      08-20-2007
copy (coll.begin(), coll.end(), ostream_iterator<int>(cout, " "));

when compile, it yields the following errors:
list1.cpp:12: error: ¡®ostream_iterator¡¯ was not declared in this scope
list1.cpp:12: error: expected primary-expression before ¡®int¡¯

I have included header file iostream and
using namespace std;

will you please explain why? any solutions?
 
Reply With Quote
 
 
 
 
Neelesh Bodas
Guest
Posts: n/a
 
      08-20-2007
On Aug 20, 2:23 pm, Scofield <(E-Mail Removed)> wrote:
> copy (coll.begin(), coll.end(), ostream_iterator<int>(cout, " "));
>
> when compile, it yields the following errors:
> list1.cpp:12: error: 'ostream_iterator' was not declared in this scope
> list1.cpp:12: error: expected primary-expression before 'int'
>
> I have included header file iostream and
> using namespace std;
>
> will you please explain why? any solutions?


#include<iterator>

-N

 
Reply With Quote
 
 
 
 
Scofield
Guest
Posts: n/a
 
      08-20-2007
Neelesh Bodas Đ´µÀ:
> On Aug 20, 2:23 pm, Scofield <(E-Mail Removed)> wrote:
>> copy (coll.begin(), coll.end(), ostream_iterator<int>(cout, " "));
>>
>> when compile, it yields the following errors:
>> list1.cpp:12: error: 'ostream_iterator' was not declared in this scope
>> list1.cpp:12: error: expected primary-expression before 'int'
>>
>> I have included header file iostream and
>> using namespace std;
>>
>> will you please explain why? any solutions?

>
> #include<iterator>
>
> -N
>

oh, sorry, i made a silly mistake.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Copy Assembly <MyAssembly> The Process Cannot Access The File Because It Is Being Used By Another Process Ram ASP .Net 2 06-30-2005 11:30 AM
Cannot delete file from webserver...... process cannot access style error news.microsoft.com ASP .Net 4 01-10-2005 06:07 AM
BOOT GENERIC virus -- cannot clean; cannot delete. Please help! wgreene Computer Support 4 08-13-2004 12:21 AM
Browser cannot find any server anymore after 5 minutes of normal activity (" The page cannot be displayed ") reply@newsgroup.please Computer Support 6 01-05-2004 04:03 AM
The file 'bin\WebProj.dll' cannot be copied to the run directory. The requested operation cannot be performed on a file with a user-mapped section open. J Gao ASP .Net 0 07-28-2003 04:18 PM



Advertisments