starting with C ++, now studying C # and just want to know why this code does not work, there are just a lot of errors in the output, I saw a few more examples from Microsoft documents and they use something called var(in particular, when using foreach) , so when I tried to use it, VS tells me that the data type vardoes not exist (maybe a missing library?) is because the reason it .Skip()doesn't work? so what should i use var? just for writing the first three letters of the stack? I really cannot say what is wrong. In fact, what I do for me is stupidity. Any help is appreciated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calendar
{
class days
{
private List <int> numbers_of_days;
private List <String> names_of_days;
public days()
{
numbers_of_days = new List<int>();
names_of_days = new List<string>
{ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" };
for (int i = 0; i < 31; i++)
{
numbers_of_days.Add(i);
}
}
public void print_days()
{
foreach (string day in names_of_days)
{
Console.Write(" " + day.Skip(3));
}
Console.Writeline();
}
}
}