Can anyone help show me how to read records line by line from a text file into structures. I know how to read the whole file but can't do line by line.
I don't know if this is correct because I'm new to C++. I tried it in
managed code. I have no idea how to do this in unmanaged code... But at
least I tried and it works. I didn't read it into structure, so I'll leave
that part to you.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
using namespace System::IO;
using namespace System::Text;
int _tmain()
{
String* strTextFilePath;
strTextFilePath = "D:\\Temp\\MyTextFile.txt";
FileStream* fs = new FileStream(strTextFilePath, FileMode::Open,
FileAccess::Read);
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.