In the following example I am trying to open a file that I have named in the command line for Read. Does anyone have any suggestions?
==========================================
#include "stdafx.h"
#include <fstream>
#include <iostream>
using namespace System;
using namespace System::IO;
using namespace System::Text;
using namespace std;
#define RSIZE 1 // Buffer size
int main( int argc, // Number of strings in array argv
char *argv[], // Array of command-line argument strings
char *envp[] ) // Array of environment variable strings
{
{
int count;
// Display each command-line argument.
cout << "\nCommand-line arguments:\n";
for( count = 0; count < argc; count++ )
cout << " argv[" << count << "] "
<< argv[count] << "\n";
}
String^ kpath = ToString(argv[1]);
// <<<<<< error C3861 "'ToString': idenifier not found"
FileStream^ kfs = File::OpenRead( kpath );
long long kL = kfs->Length;
array<Byte>^ib = gcnew array<Byte>(RSIZE); // array of 1 bytes
try
{
Console::Write(kL);
for (int i; i < kL; i++){
ifs->Read(kb, 0, RSIZE);
Console::Write(Convert::ToChar(kb[0]));
}
}
finally
{
if ( kfs )
delete (IDisposable^)kfs;
}
}
// -eof-
==========================================
Thank You in advance for any help!