Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's not quite enough detail to be sure what you're looking for, but the basic structure of what you want to do is going to look something like this:</p> <pre><code>open file.csv for writing for(iterate through one dimension of the array using i) { for(iterate through the other dimension of the array using j) { fprintf(yourfilehandle,"%d,",yourvalue[i][j]); } fprintf(yourfilehandle,"\n"); } close your file </code></pre> <p>As has been suggested by others, this will leave you with a <code>.CSV</code> file, which is a pretty good choice, as it's easy to read in and parse, and you can open your file in Notepad or Excel and view it no problems.</p> <p>This is assuming you really meant to do this with C file I/O, which is a perfectly valid way of doing things, some just feel it's a bit dated.</p> <p>Note this leaves an extraneous comma at the end of the line. If that bugs you it's easy enough to do the pre and post conditions to only get commas where you want. Hint: it involves printing the comma before the entry inside the second for loop, reducing the number of entries you iterate over for the interior for loop, and printing out the first and last case of each row special, immediately before and after the inner for loop, respectively. Harder to explain that to do, probably.</p> <p><a href="http://en.wikipedia.org/wiki/C_file_input/output" rel="nofollow">Here is a reference</a> for C-style file I/O, and <a href="http://www.cprogramming.com/tutorial/cfileio.html" rel="nofollow">here is a tutorial</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload