I need to write a function in C++ (for leisure not school) that does the following:
The function creates a file and names the file using a string (like string = "uselessfile.txt")
The file is given a random byte size that can be any reasonable size so it's not 0 bytes.
so i would have to put that information into this file somehow. Also, it would need to be very efficient. Lets say i wanted the file to be 5MB, it would be a bad idea if it froze up the program for 30 seconds.
i have no idea how to do any of this
Any help?
The function creates a file and names the file using a string (like string = "uselessfile.txt")
The file is given a random byte size that can be any reasonable size so it's not 0 bytes.
so i would have to put that information into this file somehow. Also, it would need to be very efficient. Lets say i wanted the file to be 5MB, it would be a bad idea if it froze up the program for 30 seconds.
i have no idea how to do any of this
Any help?