I am appending a string to a file after each 1 sec. I have recently foun开发者_JAVA百科d that the data rather one character is sometimes garbage or replaced. For example:
"This is a String" appears as "This is a Str&ng" or "This i%s a String"
So, my question here is that, does this correspond to file system corruption or what. Because if there would have any mistake in my code then I should have seen a long string of garbage value at the end or so. But that is not the case. I only see one character garbage value.
It follows the standard file write operation:
fHandle = fopen("A:\", "a");
strcpy(Buff, "This is a String");
fwrite(Buff, strlen(Buff), 1, fHandle); 
With only 3 lines of code in the question I can only suggest you check the file encoding and/or casts in your string arrays.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论