#include "stdafx.h"
using namespace System;
using namespace System::IO;
void main()
{
FileStream ^fso = gcnew FileStream("file.dat", FileMode::Create,FileAccess::Write, FileShare::None);
array<unsigned char>^ data = gcnew array<unsigned char> { 'T', 'h', 'i','\r', '\n' };
for (int i = 0; i < data->Length-5; i += 5)
{
fso->Write(data, i, 5);
}
fso->Close();
}
|