P
Prime Mover
In C, if I have three variables obtained in a loop like:
for(i=0;i<N;i++)
{
x[j] = ....{expression here};
y[j] = ....{expression here};
z[j] = ....{expression here};
}
And I need to print them in lines in a text file for each j, so that I
have
a text file with N lines in the end of the procces, I should make:
FILE *out;
out = fopen("output.txt","a"); // option a is for appending at the end
of the file
for(i=1;i<N;i++)
{
x[j] = ....{expression here};
y[j] = ....{expression here};
z[j] = ....{expression here};
fprintf(out,"%3.f\t%3.f\t%.3f\n",x[j],y[j],z[j]);
// I want float numbers printed with 3 precision digits...\t
prints a tabulation and \n prints a new line
}
fclose(out);
What should I do in C# do get the same result???
Thank you very much.
for(i=0;i<N;i++)
{
x[j] = ....{expression here};
y[j] = ....{expression here};
z[j] = ....{expression here};
}
And I need to print them in lines in a text file for each j, so that I
have
a text file with N lines in the end of the procces, I should make:
FILE *out;
out = fopen("output.txt","a"); // option a is for appending at the end
of the file
for(i=1;i<N;i++)
{
x[j] = ....{expression here};
y[j] = ....{expression here};
z[j] = ....{expression here};
fprintf(out,"%3.f\t%3.f\t%.3f\n",x[j],y[j],z[j]);
// I want float numbers printed with 3 precision digits...\t
prints a tabulation and \n prints a new line
}
fclose(out);
What should I do in C# do get the same result???
Thank you very much.