Oops, sorry. :(
The example code should have been:
#include "header.h"
{
ifstream infile("filename");
float *data, buff;
int size=0;
Type: Posts; User: donkeypunch
Oops, sorry. :(
The example code should have been:
#include "header.h"
{
ifstream infile("filename");
float *data, buff;
int size=0;
Your advice was very helpful. Thanks!
I just wasn't thinking about the fact that I was assigning a new pointer value to data inside the function that would be lost when it exited.
Here's an...
Hi,
I am calling a function that dynamically allocates memory for some arrays using new, and then fills the arrays with values. It is my understanding that once the function exits, the memory and...
Well, I don't really know. :(
When I open the file in Notepad, the last two lines contain no characters or spaces.
I ended up using infile.clear() after my while loop and before trying to...
My data file has two extra NULLs (blank lines) at the end. I am going to be dealing with a lot of these data files and this is how they come to me. When I remove the NULLs, the problem I described...
Okay, so by checking for when it failed I found that the file pointer is at 6311260, then it does getline, then it infile.fail() becomes true.
Sorry, for not doing this earlier, but I went to...
Thanks for your reply.
I'm using Borland C++ Builder 5.0 in Windows XP Pro.
Here's a sample:
char line[200];
ifstream infile("filename");
while(!infile.eof())
{
Hi,
I am trying to use the ifstream function seekg() to reposition a file pointer to the beginning of a text file. My code does not work when I use a text file that is about 6MB (which is the...