Click here to Skip to main content
15,910,234 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Question about input iterator on the same input stream. Pin
Joaquín M López Muñoz4-Feb-03 20:14
Joaquín M López Muñoz4-Feb-03 20:14 
GeneralRe: Question about input iterator on the same input stream. Pin
George25-Feb-03 1:17
George25-Feb-03 1:17 
GeneralQuestion about copy algorithm of STL. Pin
George24-Feb-03 19:23
George24-Feb-03 19:23 
GeneralRe: Question about copy algorithm of STL. Pin
valikac4-Feb-03 20:08
valikac4-Feb-03 20:08 
GeneralRe: Question about copy algorithm of STL. Pin
George25-Feb-03 1:09
George25-Feb-03 1:09 
GeneralRe: Question about copy algorithm of STL. Pin
Ryan_Roberts5-Feb-03 3:29
Ryan_Roberts5-Feb-03 3:29 
GeneralRe: Question about copy algorithm of STL. Pin
George25-Feb-03 19:39
George25-Feb-03 19:39 
Questionstl version of CString? Pin
Nitron4-Feb-03 13:47
Nitron4-Feb-03 13:47 
AnswerRe: stl version of CString? Pin
Michael Dunn4-Feb-03 14:04
sitebuilderMichael Dunn4-Feb-03 14:04 
GeneralRe: stl version of CString? Pin
Alexandru Savescu4-Feb-03 21:09
Alexandru Savescu4-Feb-03 21:09 
GeneralRe: stl version of CString? Pin
Tim Smith5-Feb-03 2:30
Tim Smith5-Feb-03 2:30 
GeneralRe: stl version of CString? Pin
Nitron5-Feb-03 6:16
Nitron5-Feb-03 6:16 
GeneralRe: stl version of CString? Pin
Ben Burnett7-Feb-03 13:55
Ben Burnett7-Feb-03 13:55 
GeneralRe: stl version of CString? Pin
Nitron8-Feb-03 4:31
Nitron8-Feb-03 4:31 
GeneralRe: stl version of CString? Pin
Ben Burnett8-Feb-03 5:52
Ben Burnett8-Feb-03 5:52 
GeneralRe: stl version of CString? Pin
Nick Parker10-Feb-03 5:18
protectorNick Parker10-Feb-03 5:18 
Generalpredicate function Pin
User 98854-Feb-03 7:26
User 98854-Feb-03 7:26 
GeneralRe: predicate function Pin
Joaquín M López Muñoz4-Feb-03 7:49
Joaquín M López Muñoz4-Feb-03 7:49 
GeneralRe: predicate function Pin
User 98854-Feb-03 8:04
User 98854-Feb-03 8:04 
GeneralRe: predicate function Pin
User 98854-Feb-03 8:07
User 98854-Feb-03 8:07 
GeneralDelayed QueryInterface error Exception!!! Pin
EdgarBM4-Feb-03 1:34
EdgarBM4-Feb-03 1:34 
GeneralRe: Delayed QueryInterface error Exception!!! Pin
Stefan Pedersen4-Feb-03 3:01
Stefan Pedersen4-Feb-03 3:01 
GeneralRe: Delayed QueryInterface error Exception!!! Pin
EdgarBM9-Feb-03 21:38
EdgarBM9-Feb-03 21:38 
QuestionUsing STL input iterator reading from a file ?? Pin
George24-Feb-03 0:21
George24-Feb-03 0:21 
Hi, everyone!

I meet with the following errors when compiling the
following simple codes. My IDE is VC 6.0.

Here are the codes.

--------
#include <iterator>
#include <fstream>
#include <iostream>

using namespace std;

void main()
{
ifstream ifile ("c:\\file1.txt");

istream_iterator<int, ptrdiff_t=""> r (ifile);
istream_iterator<int, ptrdiff_t=""> s (ifile);

}
--------

Here are the errors.

--------
Compiling...
testSTL.cpp
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\testSTL\testSTL.cpp(11) : error C2664: '__thiscall std::istream_iterator<int,int,struct std::char_traits<int=""> >::std::istream_iterator<int,int,struct std::char_traits<int=""> >(class std::basic_istrea
m<int,struct std::char_traits<int=""> > &)' : cannot convert parameter 1 from 'class std::basic_ifstream<char,struct std::char_traits<char=""> >' to 'class std::basic_istream<int,struct std::char_traits<int=""> > &'
A reference that is not to 'const' cannot be bound to a non-lvalue
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\testSTL\testSTL.cpp(12) : error C2664: '__thiscall std::istream_iterator<int,int,struct std::char_traits<int=""> >::std::istream_iterator<int,int,struct std::char_traits<int=""> >(class std::basic_istrea
m<int,struct std::char_traits<int=""> > &)' : cannot convert parameter 1 from 'class std::basic_ifstream<char,struct std::char_traits<char=""> >' to 'class std::basic_istream<int,struct std::char_traits<int=""> > &'
A reference that is not to 'const' cannot be bound to a non-lvalue
Error executing cl.exe.

testSTL.obj - 2 error(s), 0 warning(s)
--------

How to resolve the trouble?


Thanks in advance,
George
AnswerRe: Using STL input iterator reading from a file ?? Pin
Joaquín M López Muñoz4-Feb-03 1:40
Joaquín M López Muñoz4-Feb-03 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.