C# Programming - Structures - Discussion
Discussion Forum : Structures - General Questions (Q.No. 2)
2.
Creating empty structures is allowed in C#.NET.
Discussion:
5 comments Page 1 of 1.
Brian Andersen said:
1 year ago
var x = new int?[10]; is an empty array.
There weren't any reference to the keyword struct.
Also, one might interpret that a 'struct MyStruct {}' is empty.
There weren't any reference to the keyword struct.
Also, one might interpret that a 'struct MyStruct {}' is empty.
Andrew said:
1 decade ago
May be empty constructors?
Nicholas Mahbouby said:
1 decade ago
Creating an empty structure is allowed in C# and the compiler will not complain. However all structs implicitly inherit members from System.ValueType and thus are never really empty.
Vishal said:
1 decade ago
struct Test
{
static void Main()
{
}
}
when I create this it execute successfully. Its also a type of empty structure.
{
static void Main()
{
}
}
when I create this it execute successfully. Its also a type of empty structure.
Durg said:
1 decade ago
struct s {} // is not this empty structure
class c
{
static void Main()
{
s s1;
}
}
class c
{
static void Main()
{
s s1;
}
}
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers