how to use file operations using C like
fopen,fclose,fread,fwrite,fseek,delete,modifying.

Recommended Answers

All 2 Replies

That depends. Just how do you intend to use them? We really would need more detail to give you useful advice.

If you simply need a reference, the this should do nicely; while that site is for C++ rather than C, the C I/O libraries work the same in both languages, with the sole important difference being the name of the header file (<stdio.h> in C, <cstdio> in C++).

If you need more about the use of the functions, you would do well to search for a tutorial, such as this one.

Read through the documentation and one or more of the tutorials, then come back with specific questions if you still aren't sure how it works.

I should mention that there is no function in the standard library for deleting files; that is an operating system specific action, and you'd need to check into system calls for you paticular OS in order to find out how to do that. The same applies to renaming a file.

I should mention that there is no function in the standard library for deleting files

Yes there is -- remove()

The same applies to renaming a file.

See above link

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.