I'm learning how to write and read files in C, and I wrote a text using this code
FILE *f = fopen("testingText.txt", "w");
char *text = "This is text1...";
fwrite(text, sizeof(char), strlen(text), f );
fclose(f);
and when I read the content of this file and print it using this code
FILE *f = fopen("testingText.txt", "r");
fseek(f, 0, SEEK_END);
unsigned int size = ftell(f);
fseek(f , 0, SEEK_SET);
char *content = (char *)malloc(size);
fread(content, sizeof(char), size, f);
printf("File content is...\n%s", content);
free(content);
fclose(f);
it gives the result with strange things like these
File content is... This is text1...Path=C:*┬#æ╩eò*
and when I run the code again it gives different strange things.