It's more likely I'M confused (and almost certainly ignorant)... : )
I'm trying to write/read booleans, Strings, int's, etc. to/from a file. I
was just emulating what worked before (iostreams) and so far it does
compile. I assumed if it compiled it was correct (since it does recognize
'ostream%' and 'istream%'). But I haven't tried to save or load to any
files yet with it, so can't say it works. But it does compile!.
Here is some more code that at least compiles (these are part of a bigger
class, but note they are static methods):
#include <fstream>
using std::ifstream ;
using std:
fstream ;
static ostream% Save_Bool( ostream% output, bool value )
{
output << (value) ? int(1) : int(0) ;
return output ;
}
static bool Load_Bool( istream% input )
{
int value ;
input >> value ;
return (value == 1) ;
}
So I guess I should really be asking, since I'm programming using VS
C++.NET 2005 Express in clr:/pure syntax (at least so far), what is new
the way to read and write to files since you say its not with streams?
[==P==]
Tamas Demjen said:
I'm just curious... How can you use standard C++ library classes, such as
ostream, from a /clr
ure app? /clr
ure means you can't write unmanaged
code. I think you have to use /clr:mixed. But even then, ostream% looks
strange to me, how do you use a managed reference to an unmanaged type
like ostream? Or are you using the yet-to-be-released STL.NET's ostream?
It certainly can't be std:
stream can it? I'm confused.
Tom