- #1
dudforreal
- 116
- 0
How do you open a binary file in command in Pelles C so that it is readable?
Borek said:I would check if fopen("filename","rb") is not working.
void readFleet(Car_t toRead[])
{
FILE *fFleet;
fFleet = fopen("Fleet_File.bin", "rb");
fread(toRead, 10*sizeof(Car_t), 1, fFleet);
fclose(fFleet);
}
dudforreal said:How do you open a binary file in command in Pelles C so that it is readable?
printf("1. Add a car to the fleet.\n");
printf("2. Delete last car from the fleet.\n");
printf("3. Display full fleet on the screen.\n");
printf("4. Save the fleet to a file.\n");
printf("5. Read the fleet from a file.\n");
printf("0. Exit the program\n");
printf("\nPlease enter your choice:\n\n");
To open a binary file in command, you can use the command "open [filename]" followed by the appropriate file extension. For example, if your binary file is named "data.bin", you would use the command "open data.bin" to open it in command.
A binary file is a type of computer file that stores data in binary format, meaning the data is represented in a series of 1s and 0s. This format is commonly used for storing data that is not intended to be read or edited by humans, such as images, videos, and executables.
Yes, you can edit a binary file in command by using a text editor or a specialized binary editor. However, it is important to note that any changes made to a binary file may cause it to become corrupted and unusable, so it is recommended to make a backup copy before editing.
You can determine if a file is binary or text by opening it in a text editor. If the file contains only readable characters and does not appear to be garbled or contain random characters, it is most likely a text file. If the file contains a combination of readable and unreadable characters, it is likely a binary file.
Yes, there are special commands that can be used for working with binary files in command, such as "read [filename]" to read the contents of a binary file, "write [filename]" to write new data to a binary file, and "copy [source file] [destination file]" to copy a binary file to a new location.