LoneRanger123
Programmer
How do I read the contents into a file, or more to the point, what am I doing wrong? Here is my code
I have made sure the file is there, ATM it returns a very wide but Blank Message Box. Is there anything wrong there,
The File contains "Hello!".
Making the file longer (lots of d's in it) and running gives an error while running
"Assertion Failed: dttPtr->dttFlags & (DTCVF_PTRVAL|DTCVF_RETVAL ),file xx.cpp, line 3735" In Debug Mode
Code:
//HEADERS.....
...
#include <iostream.h>
#include <fstream.h>
...
//MOVING ONTO MAIN CODDE (IN LOAD SECTION OF PROGRAM)
ifstream infile;
String Hello;
char Temp[255];
infile.open ("C:\\Hello.txt", ifstream::in);
infile.read(Hello.c_str(),255);
MessageDlg(Hello,mtError,TMsgDlgButtons() << mbOK,0);
I have made sure the file is there, ATM it returns a very wide but Blank Message Box. Is there anything wrong there,
The File contains "Hello!".
Making the file longer (lots of d's in it) and running gives an error while running
"Assertion Failed: dttPtr->dttFlags & (DTCVF_PTRVAL|DTCVF_RETVAL ),file xx.cpp, line 3735" In Debug Mode