Priti Kumari
Is Empty structure allowed in C#?
By Priti Kumari in C# on Dec 24 2013
  • Rahul Prajapat
    Jun, 2015 1

    yes it may be public struct sts {} static void Main(string[] args) {sts stm;}

    • 1
  • Monika Parekh
    Dec, 2013 30

    No, Its not allowed. A struct can't be null in the same way that an int can't be null, and a float can't be null - they're all value types (and really, a developer should care if they're on the stack rather than on the heap). Nullable types make dealing with SQL a lot easier...

    • 1
  • Mukesh Kumar
    Sep, 2017 5

    No

    • 0
  • Pankaj  Kumar Choudhary
    May, 2015 25

    yes it may be public struct sts{} static void Main(string[] args){sts stm;}

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS