Search:

Type: Posts; User: sirsmilealot

Search: Search took 0.00 seconds.

  1. Replies
    12
    Views
    2,065

    Thank you ever so much Salem, I understand now,...

    Thank you ever so much Salem, I understand now, much better the fgets() approach! Thanks also to Elysia for your comments!
  2. Replies
    12
    Views
    2,065

    Thanks Elysia - I'll have a go at this now. ...

    Thanks Elysia - I'll have a go at this now.

    Salem - The full text file is attached above in an earlier post though here are 10 lines in any case:



    2.67 2.464
    2.393 1.228
    2.167 0.657...
  3. Replies
    12
    Views
    2,065

    Thanks Salem, I tried your suggested code but...

    Thanks Salem,

    I tried your suggested code but this resulted in my program only reading in 1 value from the text file?! I'm really quite confused now haha!

    I slotted the if/else statement into...
  4. Replies
    12
    Views
    2,065

    With all due respect, this may be "trivial" to...

    With all due respect, this may be "trivial" to you though I've only been programming for a few days! I do have a debugger and it runs without fail. You say they aren't initialised but I've now done...
  5. Replies
    12
    Views
    2,065

    OK - I've managed to resolve this issue, only to...

    OK - I've managed to resolve this issue, only to find another later down the line! When working out the minimum value stored within the two arrays I get an unexpected output for the first column of...
  6. Replies
    12
    Views
    2,065

    Thanks for your help Elysia - I realised it would...

    Thanks for your help Elysia - I realised it would be much easier to re-use the counter 'i' as this will have effectively 'counted' the number of elements into the array. I *think* this is problem...
  7. Replies
    4
    Views
    1,660

    If you're going to post onto these forums for...

    If you're going to post onto these forums for help, at least think twice before submitting your code if you're worried about others "cheating". This is a public forum and not somewhere for...
  8. Replies
    12
    Views
    2,065

    Segmentation fault

    Hello All,

    I'm new to C programming and have been set an assignment. We are to read in float values from a text file and insert them into two arrays, then perform certain manipulations to the...
  9. Replies
    12
    Views
    12,596

    Well, thanks a lot for all your help - I'd have...

    Well, thanks a lot for all your help - I'd have been stuck for hours more otherwise! I've now got to:

    b) Calculate and print to screen the total and average of each column
    c) Calculate and print...
  10. Replies
    12
    Views
    12,596

    Ah, I see where we're goin' with this. I only...

    Ah, I see where we're goin' with this. I only started programming in C a couple of days ago so I've a long way to go yet but already it's starting to make sense! I'm still slightly confused about how...
  11. Replies
    12
    Views
    12,596

    OK - thanks folks I now have the data into two...

    OK - thanks folks I now have the data into two arrays! nadroj - you mentioned it to be bad practice using feof() to control a loop, and I can now see for why as the last value stored into the array...
  12. Replies
    12
    Views
    12,596

    Thanks also nadroj. Above is the text file, the...

    Thanks also nadroj. Above is the text file, the columns are seemingly only separated by a space. (Ignore the alternate line spaces).
  13. Replies
    12
    Views
    12,596

    Thanks for your reply Adak. I have tried your...

    Thanks for your reply Adak. I have tried your first suggestion but this doesn't seem to separate the columns into one array from the other. Here is a shortened version of the text file:


    ...
  14. Replies
    12
    Views
    12,596

    Read in float values from two columns

    Hello All,

    I'm having trouble getting this code to work. Basically, I have been given a '.txt' file with two columns of extensive float values. We have been asked to write a program that will...
Results 1 to 14 of 14