![]() |
| | #1 |
| Guest
Posts: n/a
| That statement above writes to a data file but stops after about a hundreds line are written. The data that is stored in array[0] is created as the file is being written (dynamically??) How do I code so that I can continously write to a file as the data is being created? Thanks, Donald |
|
| | #2 |
| Guest
Posts: n/a
| sprintf(string, " %g", draw_geom_buf.value[0]); fprintf(output,"%s\n",string); this the actual code sorry. Donald |
|
| | #3 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,676
| > How do I code so that I can continously write to a file as the data is being created Can you explain how this is being achieved? In a single thread, you're either modifying the array or writing to the file. |
| Salem is offline | |
| | #4 | |
| End Of Line Join Date: Apr 2002
Posts: 6,240
| Re: writing contents of array to file Quote:
__________________ When all else fails, read the instructions. If you're posting code, use code tags: [code] /* insert code here */ [/code] | |
| Hammer is offline | |
| | #5 |
| Guest
Posts: n/a
| I have it. I forgot to fclose(output); this flushes all the data created during the execution of the main program to the output file after the main program is exited. The data is basically written to the file during the execution of the program then when you exit the program the rest of the data stored in the array is flushed out to the data file. Without fclose() the rest of the data that is stored in the array is not written to the data file, resulting in a inacurate data file. Once again fclose() saves the day. |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A development process | Noir | C Programming | 32 | 12-19-2009 10:15 AM |
| File Writing Problem | polskash | C Programming | 3 | 02-13-2009 10:47 AM |
| opening empty file causes access violation | trevordunstan | C Programming | 10 | 10-21-2008 11:19 PM |
| Basic text file encoder | Abda92 | C Programming | 15 | 05-22-2007 01:19 PM |
| Struct *** initialization | Saravanan | C Programming | 20 | 10-09-2003 12:04 PM |