C#C
C#13mo ago
UKPL

✅ "Build failed. Fix the compilation errors and try again."

So I started C# just a week ago and I've been struggling with a weird error message whenever I do
dotnet run
in the console. Everything was going just fine as soon as I add the
int[] correctAnswers = {2, 2, 1};
to the code. Even after I removed it, the error is still the same... I do have .NET version 8.0 and every needed extension installed so I don't really understand why it's popping out. I've been trying to seek the answer on YouTube or via ChatGPT but they both failed. I'd love some help.
The code:
using System;
class Program {
    static void Main(string[] args) {
        Console.WriteLine("e");

        string[] pytania = {
            "1. Ile nóg ma pająk?",
            "2. Która planeta jest najbliżej Słońca?",
            "3. Stolica Polski to?"
        };

        string[,] odpowiedzi = {
            {"1. Sześć", "2. Osiem", "3. Cztery"},
            {"1. Wenus", "2. Merkury", "3. Mars"},
            {"1. Warszawa", "2. Wrocław", "3. Gdańsk"}
        };

        int[] correctAnswers = {2, 2, 1};
    }
}
Was this page helpful?