![]() |
| ||
| fread, fwrite issues One of the things I can't get working is reading and writing a structure to and from a file in binary. I'm sure that I'm using fread and fwrite correctly. However, I keep getting crashes which I cannot find ways to debug. #include <stdio.h> |
| ||
| Re: fread, fwrite issues If you want to write array of structures in file you should use loop to store each member. Coinsider this code: #include <string.h>Now, I think you'll know what to do... |
| ||
| Re: fread, fwrite issues I know its possible to write binary files because I've done it hundreds of times, and so has almost everyone else. This works for me. #include <stdio.h> |
| ||
| Re: fread, fwrite issues so you're allowed to change the state of the file by pointing the pointer elsewhere? |
| ||
| Re: fread, fwrite issues How would I copy data from one file directly to another? I tried this syntax: void disp_all(FILE *fp) {and it doesn't seem to work :sad: fp is in "rb" mode. I want to write the file that fp is pointing to directly into a temporary file that ftemp is pointing to. |
| ||
| Re: fread, fwrite issues read the description of the open flags -- one of the allows both read and writes and your program only opens the file once. |
| ||
| Re: fread, fwrite issues Quote:
http://c-faq.com/struct/io.html |
| ||
| Re: fread, fwrite issues ok, i read the website that ancient dragon posted up and it was pretty helpful. I managed to get the file copying function of my program to work :) |
| All times are GMT -4. The time now is 11:10 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC