I need to read one wide Charecter(wchar_t) from a file once but it says:
"ambiguous overload for 'operator>>' in 'WER >> mont'

The part that also confuses me is that it writes the Charecter just fine.

It is only one Charecter not a string if that makes a difference.
Thanks.

Recommended Answers

All 4 Replies

Please post a complete test program that exhibits the error.

Really simple:

wchar_t qwer;
ifstream asdf ("DATA.dat");
asdf>>qwer;
asdf.close();

I know that there is only one wide Charecter in data.dat.

Why are you using ifstream instead of wifstream? If you're working with wide characters, it's generally a good idea to use wide character oriented classes.

I thought that only applied to cin and cout (as wcin and wcout). Does normal stuff go though these wide vareants nomaly, There's going to be two other lines of non wideness in the file (it a savegame thing)?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.