Search:

Type: Posts; User: Adak

Search: Search took 0.09 seconds.

  1. Replies
    20
    Views
    41,733

    My final version of this used just the two...

    My final version of this used just the two include files of stdio.h and string.h.

    variables included:
    char data[128], small[30]
    int i,j,lendata
    double real
    FILE *fp

    and a few misc one's.
  2. Replies
    20
    Views
    41,733

    Please don't keep quoting what I just posted. I...

    Please don't keep quoting what I just posted. I know what I posted, and it takes up a lot of space.

    Thanks, and you're welcome.
  3. Replies
    20
    Views
    41,733

    Yes, I know you have a lot of lines of data....

    Yes, I know you have a lot of lines of data. Don't worry about the number of lines of data now, however. That's a detail!

    Right now, get ONE line of test data, to work correctly, with all types...
  4. Replies
    20
    Views
    41,733

    As it turns out, the standard for C, is to round...

    As it turns out, the standard for C, is to round out the last digit of real numbers (when appropriate), so simply using it leads to a much simpler program.

    An example (this works with only the...
  5. Replies
    20
    Views
    41,733

    OK, (that was fast!), but you don't want to just...

    OK, (that was fast!), but you don't want to just copy the data, before the data has been changed, if a number needs changing.

    Before you write out the line of text, check it it has a decimal...
  6. Replies
    20
    Views
    41,733

    OK, well crap! I thought you had to do the...

    OK, well crap! I thought you had to do the rounding manually - which is more involved of course - so you will not use the info I posted.

    Use fgets() to put the entire line of text into a char...
  7. Replies
    20
    Views
    41,733

    I will show you mine, if you will show me yours! ...

    I will show you mine, if you will show me yours! ;)

    It's a little touchy - which is why we have round up functions in C, built in. You CAN do it yourself, and it's a great exercise to do so, but...
  8. Replies
    20
    Views
    41,733

    OK, every line of data that has no number with a...

    OK, every line of data that has no number with a decimal point, can be written out exactly as it is -- fgets() will do that exactly for you.

    Every line WITH a decimal point in it, needs to be...
  9. Replies
    20
    Views
    41,733

    When I have a lot of parsing to do, I like to use...

    When I have a lot of parsing to do, I like to use fgets(myCharArray, sizeof(myCharArray), filePointer), to put each line of text, into the char array. Then work with the parsing, in the char array....
Results 1 to 9 of 9