I have the following function:
static public void logEntry( string expression, string result )
{
string content = expression + "=" + result + "\n";
if (!logFileExists()) File.Create( logFileName );
StreamWriter sw = new StreamWriter( logFileName );
sw.Write( content );
sw.Close();
}
...after these three calls:
logEntry( "3/2", "1.5");
logEntry( "8/2", "4");
logEntry( "10/2", "5");
my file looks like this:
10/2=5
instead of this:
3/2=1.5
8/2=4
10/2=5
What could I do?