Codeblocks, C. I'm trying to write characters to a .txt file, using fwrite. The first couple of characters get written correctly, but after them the file says: _mcleanup: tos ov. I think it might be a buffer overload. Any ideas?
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
FILE*p1;
p1=fopen("Tomi.txt","w+");
fseek(p1,0,SEEK_SET);
// fwrite("Toth Tamas",sizeof(char),30,p1);
while(a<10)
{
fwrite("Toth Tamas",sizeof("Toth Tamas"),1,p1);
a++;
}
return 0;
}