Which of the following is the correct way to settle down values into the structure variable 'e' defined in the following C# code snippet?
struct emp
{
public String name;
public int age;
public Single sal;
}
emp e = new emp();
struct emp
{
public String name;
public int age;
public Single sal;
}
emp e = new emp();A.
e.name = "Jone";
e.age = 24;
e.sal = 200;B.
With emp e
{
.name = "Jone";
.age = 24;
.sal = 200;
}C.
name = "Jone";
age = 24;
sal = 200;D. All of the mentioned
Answer: Option A
Related Questions on Classes and Objects in C Sharp
A. A blueprint for creating objects
B. A method in C#
C. A variable in C#
D. A data type in C#
A. A method in C#
B. A variable in C#
C. An instance of a class
D. A data type in C#
A. public
B. private
C. protected
D. internal

Join The Discussion