Hongliang Wang <
loud...@gmail.com> wrote:
> Could anybody tell me if g++ has a wide char support version of
> freopen() and _flushall() function?
It's not a question about g++ but about the C library you're
using with it, so a hopefully correct answer can only be "it
depends". If the library is the GNU C library (glibc) then
it supports a non-standard addition to the mode string for
fopen() and freopen(), ",ccs=string", where, citing from
the man page:
"'string' is taken as the name of a coded character set and
the stream is marked as wide-oriented."
There's no _flushall() function in glibc I've ever heard of,
this seems to be something Microsoft invented. Use fflush()
with a NULL pointer to flush all open *output* files - it
shouldn't matter if the file was opened with wide char sup-
port or not. Note that this only flushes the internal buf-
fers of the (GNU) C libraray, if you have to ensure that the
data are physically written to disk (as far as that is pos-
ible) you'll have to do an additional call of sync().
Regards, Jens
--
\ Jens Thoms Toerring ___
j...@toerring.de
\__________________________
http://toerring.de