Search:

Type: Posts; User: donkeypunch

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    3,446

    Oops, sorry. :( The example code should have...

    Oops, sorry. :(

    The example code should have been:

    #include "header.h"

    {
    ifstream infile("filename");
    float *data, buff;
    int size=0;
  2. Replies
    4
    Views
    3,446

    Your advice was very helpful. Thanks! I just...

    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...
  3. Replies
    4
    Views
    3,446

    using new inside functions

    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...
  4. Replies
    8
    Views
    1,284

    Well, I don't really know. :( When I open the...

    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...
  5. Replies
    8
    Views
    1,284

    My data file has two extra NULLs (blank lines) at...

    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...
  6. Replies
    8
    Views
    1,284

    Okay, so by checking for when it failed I found...

    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...
  7. Replies
    8
    Views
    1,284

    Thanks for your reply. I'm using Borland C++...

    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())
    {
  8. Replies
    8
    Views
    1,284

    pointers into largish text files

    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...
Results 1 to 8 of 8