ok so i have a structure of customers and i am trying to write each attribute of the customer in a separate line in a text file. Here is the code
custFile = fopen ("customers.txt", "w+");
fprintf(custFile, "%s", cust[cust_index].name);
fprintf(custFile, "\n");
fprintf(custFile, "%s", cust[cust_index].sname);
fprintf(custFile, "%s", cust[cust_index].id);
fclose(custFile);
The data is form the text file is outputted in one line
The data is fine, it is just printed in one line. When i gave my friend my code, it worked as it should.
P.s i dont know if it makes any difference but i am programming on a mac