7/27/2023 0 Comments Convert c file to hex file onlineI tried googling to see if others were trying to do the same thing, but people were either already reading from a binary file or already had hexadecimal values in the file. How can I structure this program so that it reads the hexadecimal values of a standard text file and either (a) puts them in an array (which I think should be simple enough with a for loop) or (b) prints them out to the screen? ![]() However, the problem is that even though I'm in "read binary" mode, it won't give me the hexadecimal values of the text file. Printf("The contents of %s file are :\n", file_name) Īs you can see this is really just a simple file in, read and print contents. Perror("Error while opening the file.\n") ![]() Printf("Enter the name of file you wish to see\n") įp = fopen(file_name,"rb") // read binary mode txt file and not a binary file) and store it in an array for later. For example, say I had the text file "helloworld.txt" that simply had the words "Hello World!" in it, I want to specify to the program to take that file, read its hexidecimal values (again the file is a simple. I want to take in a file and view its hexadecimal values. I am writing a c program that functions much like a hex editor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |