Search:

Type: Posts; User: juice_box

Search: Search took 0.01 seconds.

  1. Using fscanf to read a file over and over again

    I need to analyzed some data over and over again with changed parameters each time, how do I get fscanf to read to the end of a file and then start over at the beginning again?

    Thanks.
  2. Replies
    4
    Views
    7,825

    Oh sorry, those floats are meant to be integers,...

    Oh sorry, those floats are meant to be integers, I was just trying some stuff and I forgot to change it back. Revised code:



    int j , i;
    int rows = 1;
    float num;
    int c;

    while ((c =...
  3. Replies
    4
    Views
    7,825

    2-Dimensional Dynamic Array

    Hi,
    I tried to get my program to count the number of rows in the input data file and then output back the same data with 7 columns and however many rows. It's giving me all zeros in the output file...
  4. Oh hey! I figured it out, I'm not supposed to use...

    Oh hey! I figured it out, I'm not supposed to use %f and declare the variable as a non-float type. Okay cool, thanks anyways.
  5. fscanf still not working properly

    Thanks, I've fixed up my code. The fscanf function still isn't working right though, I get the right output format but all the values in the matrix are just 0.

    I think it's mainly just this part...
  6. How to use fscanf to read in data from a file into a multidimensional array

    Hello,
    I'm working on a program that is meant to take a file formatted like:

    100 200 300 10 20 30 5
    1 2 3 4 5 6 7
    12 23 34 45 56 67 78
    88 99 33 11 22 55 66
    98 87 76 65 54 43 32

    There a lot...
Results 1 to 6 of 6