I don't understand why the output file does not contain any text? Why is the array not writing to file? I receive no error whilst running it..
Console.Write("Please enter a name for the homework: ");
hmwk[1].name = Console.ReadLine();
Console.Write("Please enter the subject: ");
hmwk[1].type = Console.ReadLine();
redo:
Console.Write("Please enter the date the homework was set xx/xx/xx: ");
string toconvert = Console.ReadLine();
DateTime temp;
if (DateTime.TryParse(toconvert, out temp)== false)
{
goto redo;
}
DateTime converted = DateTime.Parse(toconvert);
hmwk[1].dateset = converted;
redo2:
Console.Write("Please enter the date the homework deadline is: ");
toconvert = Console.ReadLine();
if (DateTime.TryParse(toconvert, out temp) == false)
{
goto redo2;
}
converted = DateTime.Parse(toconvert);
hmwk[1].deadline = converted;
StreamWriter outfile = new StreamWriter("homework.txt", false);
outfile.WriteLine(hmwk[1].name);
outfile.WriteLine(hmwk[1].type);
outfile.WriteLine(hmwk[1].dateset);
outfile.WriteLine(hmwk[1].deadline);
Console.WriteLine("You have added the homework. Press Enter.");