LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C File reading and writing (https://www.linuxquestions.org/questions/programming-9/c-file-reading-and-writing-319676/)

AbhishekSamuel 05-03-2005 07:31 AM

C File reading and writing
 
hi

I was writing an application where i need to write text to a file whose size is determined at runtime.

I am familiar with this

struct book
{
int num;
char msg[FIXED_SIZE];
};

Then performing fread and fwrite.
But what i require is char *msg rather than msg[FIXED_SIZE].

Could anyone give me some reference or a snippet of how to do this.

Thank You
Abhishek Samuel

pycoucou 05-03-2005 07:40 AM

I don't get exactly your point

your two variables message are equivalent: msg[0]=*msg

Sorry for this poor help, but I'm not fully acquainted with de details of fwrite but I guess that typecasting would be sufficient.

PY

Dave Kelly 05-03-2005 10:58 AM

Question: Class assignment.
Library Card Program?

introuble 05-03-2005 03:59 PM

malloc()


All times are GMT -5. The time now is 02:49 PM.