I am new to file write/read operations in C programming. Is there a solution to write all printf() which is on the below, to my output txt file? I could not write all the lines to my txt file.
for(i=0;i < n;i++)
if(i!=startnode)
{
outputFile = fopen(myOutputFile, "w");
printf("nCOST of %d = %d", i, cost[i]);
printf("nTRACE = %d", i);
j=i;
do
{
j=pred[j];
printf(" %d", j);
}
while(j!=startnode);
}
