Witam,
Nie jestem pewien dlaczego nie mam dostępu do utworzonego obiektu w ten samej klasie / strukturze, aby wykonywać na nim dalsze operacje:
Mam taki kod:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test_struktur
{
public struct Jajo
{
public string Country;
public int Size;
public static void build_file(string path, string mode)
{
Jajo[] jajko = new Jajo[0];
jajko[0].Country = mode;
jajko[0].Size = ask_dane();
}
static int ask_dane()
{
int data;
if (jajko[0].Country == "PL") // The name 'jajko' does not exist in the current context.
{ data = 2; }
else
{ data = 1; }
return data;
}
}
}