Re: how make cast from ifstream to istream in MS Visual C++
From: John Harrison (john_andronicus_at_hotmail.com)
Date: 09/07/04
- Next message: velthuijsen: "Re: Function Returning a local object???"
- Previous message: ragi: "how make cast from ifstream to istream in MS Visual C++"
- In reply to: ragi: "how make cast from ifstream to istream in MS Visual C++"
- Next in thread: Jonne Lehtinen: "Re: how make cast from ifstream to istream in MS Visual C++"
- Reply: Jonne Lehtinen: "Re: how make cast from ifstream to istream in MS Visual C++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 7 Sep 2004 12:31:04 +0100
"ragi" <rafgiez74@interia.pl> wrote in message
news:chk57q$2tec$1@mamut.aster.pl...
> Short version of my program:
>
> ifstream File;
>
> File.open("test.txt");
> if(!File.good()) return;
>
> Func(File); <--cannot convert parametr 1 from 'std::ifstream' to
> 'std::istream'
>
>
> and declaration is:
>
> bool Func(std::istream);
>
>
> What should I do to solve these problem ?
bool Func(std::istream&);
Always pass streams by reference (or pointer) they cannot be copied.
john
- Next message: velthuijsen: "Re: Function Returning a local object???"
- Previous message: ragi: "how make cast from ifstream to istream in MS Visual C++"
- In reply to: ragi: "how make cast from ifstream to istream in MS Visual C++"
- Next in thread: Jonne Lehtinen: "Re: how make cast from ifstream to istream in MS Visual C++"
- Reply: Jonne Lehtinen: "Re: how make cast from ifstream to istream in MS Visual C++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|