You want to make an infinite loop which sets the contents of a file to a number from 1 to 36 ?
open and close the file inside the loop, or use seekp (though I have a feeling that if the file contained 36 and you wanted to write 1 in it, the result would be 16. If that happens, write a ' ' to clear that second number. I honestly don't know how to erase things from a file..).
By the way,
I'd ask why would you want to do that, but for some reason I'm afraid of the answer. Is this really what you need?
yes this is what i need i want to make a good dice program(u already know rand() is not good )
is there something u afraid and i dont know how to clear