Ошибка в коде: somestruct.e must be fully assigned before control is returned to te caller - C#
Формулировка задачи:
а что за ошибка,никак не могу понять
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication20
- {
- class Program
- {
- static void Main(string[] args)
- {
- }
- }
- public class Example
- {
- public int x;
- public Example(int a)
- {
- x = a;
- }
- }
- public struct SomeStruct
- {
- public int a;
- public Example e;
- public SomeStruct(int k,int t)
- {
- a = k;
- e.x = t;
- }
- }
- }
Решение задачи: «Ошибка в коде: somestruct.e must be fully assigned before control is returned to te caller»
textual
Листинг программы
- public struct SomeStruct
- {
- public int a;
- public Example e;
- public SomeStruct(int k, int t):this()
- {
- e = new Example(11);
- a = k;
- e.x = t;
- }
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д