I'm not sure how to word it, so the title may be unclear. Here's the line in question
strcpy (stringstore,"int1: %d\nint2: %d\nint3: %d\nint4: %d\nstring1: %s\nstring2: %s\n",int1,int2,int3,int4,string1,string2);
This is inside a for loop so the values of the ints and strings are changing. I want to store each string in stringstore. How would I be able to do this?
EDIT: Here is more code.
int id;
int year;
char title[30];
char director[30];
double price;
double length;
int i;
char stringstore[300];
FILE *outp;
outp= fopen("CurrentCatalog.txt","w");
for (i = 0;i<=*size;i++)
{
id = entry[i].id;
year = entry[i].year;
strcpy(title,entry[i].title);
strcpy(director,entry[i].director);
price = entry[i].price;
length = entry[i].length;
fprintf(outp,"ID: %d\nTitle: %s\nDirector: %s\nYear: %d\nPrice: %.2f\nLength: %.2f\n",id,title,director,year,price,length);
}
fclose(outp);