Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Passing a file path as argument and reading it
I need to write an utility that takes a file name or file path as argument, open and read the file. Then I need to convert it to binary and write it to another file.
I could not figure how I could pass a file path (ex:C:/usr/temp/Cprograms/prog1.c). When a path like this is given how do I read it and open the file.
For writing to the file can I use fwrite(). Is there any other method to do this.
0 · ·