I want to store some strings in a text file (one string per line), but on compilation, some unnecessary zeroes get added at the end of each string in the text file. Following is my code :- **
#include <stdio.h>
#include <string.h>
int main()
{
int i=0;
char *name[4]={"ABC","agb","thi","yuun"};
FILE *pp;
pp=fopen("random_name.txt","w");
for(int i=0;i<4;i++)
{
fwrite(name[i],strlen(name[i])+1,1,pp);
fputs("\n",pp);
}
fclose(pp);
return 0;
}