ifstream & ofstream manipulators equivalents in C++/CLI
-
-
ifstream INPUT ("INPUT.csv");
INPUT << Cell1;
INPUT.close();ofstream OUTPUT ("OUTPUT.csv");
OUTPUT << Heading1;
OUTPUT.close();Any body could please tell me what are the C++/CLI equivalents for the INPUT / OUTPUT manipulators above? Many thanks.
Look at the FileStream[^] class. StreamReader[^] and StreamWriter[^] can also be used. :)
Navaneeth How to use google | Ask smart questions
-
Look at the FileStream[^] class. StreamReader[^] and StreamWriter[^] can also be used. :)
Navaneeth How to use google | Ask smart questions
Thanks a million, that was an excellent source of info. It all works apart from the AddText function below.
void AddText( FileStream^ fs, String^ value )
{
array<Byte>^info = (gcnew UTF8Encoding( true ))->GetBytes( value );
fs->Write( info, 0, info->Length );
}I have added
System::IO::
before
FileStream
but the compiler still returns an error regarding the UTF8Encoding... :doh:
-
Thanks a million, that was an excellent source of info. It all works apart from the AddText function below.
void AddText( FileStream^ fs, String^ value )
{
array<Byte>^info = (gcnew UTF8Encoding( true ))->GetBytes( value );
fs->Write( info, 0, info->Length );
}I have added
System::IO::
before
FileStream
but the compiler still returns an error regarding the UTF8Encoding... :doh:
Try this
array<Byte>^ info = System::Text::Encoding::UTF8->GetBytes(value);
:)
Navaneeth How to use google | Ask smart questions