I need to create a program that writes a file of bytes
, with the name that is entered, with a number and ask if that number is Mb
or Gb
and I already have the following code developed, although I think that is not the best way to do it because the file that is generated must contain "0xAA" which are 01, I really do not know how to write this type of data ...
with the for I have what string I print write "x" times to get to the desired way
for (i=0; i<=((529000)*numero*1000);i++)
instead of printing
fprintf(fichero, "%s","01");
but I would like to know how to print something similar to this:
memset(*buffer, 0xaa, 1024);
or that is my question is the best way to print the "x" times the string so that the file that is created has the specified size?