Have you considered the possibility that it is not the {} that is the issue, and that instead the issue is that the above fprintf() command does not specify which text file to write to?

The code is intended to be sample code to allow you to examine the behavior and refine for yourself what precise format you want to use. After you have worked that out, adjust the fprintf() to reflect the file identity you want to write into.