Search:

Type: Posts; User: oopsyourhead

Search: Search took 0.01 seconds.

  1. I'm not really sure why you have a loop in your...

    I'm not really sure why you have a loop in your getRand() function. Is that so you can generate more numbers later on? It seems like it's just there to be there, and adding code that is not needed is...
  2. Replies
    3
    Views
    1,003

    I was using char arrays because it seemed...

    I was using char arrays because it seemed logical. The .open function call will not take std::string as an argument, only char arrays. So it seemed logical to use those rather than having to convert...
  3. Replies
    3
    Views
    1,003

    strcopy problems, file I/O

    I'm trying to let the user dynamically enter the name for text files that they are reading into my program, as well as what they what the output to be.

    I know with C++, that ifstream and ofstream...
  4. Replies
    14
    Views
    2,986

    OK so now I have the correct output for the...

    OK so now I have the correct output for the program I was writing. The problem, is is that I need some additional info from this output file.

    ID IC TIME
    15:23:43.867 /g/mydata/dataoutputfile.txt...
  5. Replies
    14
    Views
    2,986

    This method seems to be much easier to...

    This method seems to be much easier to understand, the one problem i'm haing is from the one where I try and read the hex codes into an array of ints.



    //junk 1 is the discarded hex code
    else...
  6. Replies
    14
    Views
    2,986

    It seems like if I decide to use a separate...

    It seems like if I decide to use a separate stringstream for each line, that using the loop to parse through it will not work.

    While doing each line separately will work for a short file, the file...
  7. Replies
    14
    Views
    2,986

    OK, so now I've gotten it to kind of discern...

    OK, so now I've gotten it to kind of discern between my if/else if/else, but now the else if isn't reading the right characters:



    #include <iostream>
    #include <sstream>
    #include <fstream>...
  8. Replies
    14
    Views
    2,986

    I don't think I'm properly grasping why this...

    I don't think I'm properly grasping why this isn't working.


    #include <iostream>
    #include <sstream>
    #include <fstream>
    #include <iomanip>

    using namespace std;
  9. Replies
    14
    Views
    2,986

    Is there a way to know that stringstream failed...

    Is there a way to know that stringstream failed the ss call? Or do I just assume that it failed and clear it anyway?

    And should I clear it after the if/else if/else?
  10. Replies
    14
    Views
    2,986

    I think I understand the process here, but I...

    I think I understand the process here, but I think i'm stuck on how to properly parse. I can read in the time code that I need just fine, but when I go to pick out the hex codes I'm having some...
  11. Replies
    14
    Views
    2,986

    parsing through a text file

    I decided to try my hand at C++ in order to get this done.

    I have a source text file that is formatted like this:

    15:20:35.334 Race /myfolder/racenumber3234.rdc, /myfolder/racenumber3234.rdc,...
  12. Replies
    5
    Views
    1,273

    OK, I've managed to get the first line read in...

    OK, I've managed to get the first line read in using fgets and assigned to variables using sscanf. Now how do I get it to read in the following lines?

    I've tried it this way, but it doesn't seem...
  13. Replies
    5
    Views
    1,273

    text file reading problems

    I'm having some trouble figuring out how to pass these values from a text file into variables so I can rearrange them into columns and do some operations.

    BLOCK 4 16:04:35.774

    0: ABCD...
Results 1 to 13 of 13