[BIG HELP:] File Reading and Writing in C

hello guys!!! pls help me with my probem..

i just want to make a simple database like,,

the program will ask the user if he wants to edit the existing info. in the "printf", but if he edit it, the details he typed will store in a .TXT file,

for ex.:


#include<stdio.h>
main()
{
printf("I am .R.");
/*then the program will ask if the user wants to edit the details in "printf", if the user want it, then the program wil provide a .txt file, that will be the database of the program where the details will be stored if the user edited the "printf".*/

I JUST NEED A SAMPLE CODE SO THAT I COULD ANALYZE IT. TNX!!!


pls help me guys... ASAP pls.. tnx!
What?
what ?
umm,

look into scanf, fscanf, fprintf, sprintf. Most of them work just like printf.

to do a data base type file look into a keyword called "struct" in the c references or your text book.

or at this link: http://www.cplusplus.com/reference/clibrary/cstdio/
most of the file io stuff is in stdio.h, it shouldn't matter which system you are on.

You need to know about fopen and fclose respectively for what you are thinking about.
Topic archived. No new replies allowed.