Re: wifstream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2014-08-15 at 15:40 -0400, ArbolOne wrote:
> I see, VC has it's own way of doing things, thank you for advice. One
> more question, where can I have reference to standard library?

http://en.cppreference.com is usually a good place to start.

> 
> On 15/08/2014 11:54 AM, Jonathan Wakely wrote:
> > On 15 August 2014 16:49, ArbolOne wrote:
> >> In my Windows 7 this code doesn't work:
> >> std::wstring& getFileName() {
> >>       return file_name;
> >> }
> >> myMethod(){
> >> wchar_t tmp = *getFileName().c_str() ;
> >>       std::wifstream infile( tmp ); // <<-- error: invalid conversion
> >> from 'wchar_t' to 'const char*' [-fpermissive]
> >>       return infile.good( );
> >> }
> >>
> >>
> >> It seems to me that  std::wifstream does not accept wchar_t as a value
> >> type, but only const char*, contrary to to what is explained in
> >> http://msdn.microsoft.com/en-us/library/3b5w4311.aspx
> > That is describing the MS library, it's not the standard.
> >
> >> Where did I go wrong? or, is this a bug?
> > No, the standard says that basic_fstream always takes narrow character
> > strings to specify the filename, even if the stream itself uses wide
> > characters.
> 






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux