![]() Use fputs() function to write data to fPtr i.e. First string data to write into file, next pointer to FILE type that specifies where to write data. fputs("content-to-write", stream) function accepts two parameters. For this post to make things simple I will use fputs() function to write data to file. ![]() C provides several functions to perform IO operation on file.Input data from user to write into file, store it to some variable say data.On success it return pointer to FILE type otherwise NULL pointer. We will use w file mode to create a file.įopen("file-name", "read-mode") function accepts two parameter first file name to read/create/write/append data, next is file open mode. You can open a file in basic three different mode r(read), w(write) and a(append) mode. fopen() function is used to open a file in different mode. Create or open file using fopen() function.Declare a FILE type pointer variable to store reference of file, say FILE * fPtr = NULL.
0 Comments
Leave a Reply. |