Hi all,
I have been trying to simply write some data to a file using the semihost and corresponding redlib libraries. Below is the code I am using - I can create the file in the correct directory, however, it just stalls when it gets to fprintf. I've read a few posts here saying that the issue is normally not using the semihost-compatible C libraries, but I've made this fix and cannot get the fprintf function to work. Can someone please help?
//
FILE *fp = fopen("C:\\Users\\BApoo\\Desktop\\Test.txt","w");
if(fp == NULL)
{
printf("Error opening file!\n");
exit(1);
}
const char *text = "This is a string which is written to a file.";
fprintf(fp, "%s\n", text);
fflush(fp);
fclose(fp);
//