C# Programming - Structures - Discussion

Discussion Forum : Structures - General Questions (Q.No. 4)
4.
Which of the following is the correct way of setting values into the structure variable e defined below?
struct Emp
{
    public String name;
    public int age;
    public Single sal; 
}
Emp e = new Emp();
e.name = "Amol"; 
e.age = 25; 
e.sal = 5500;
With e
{
    .name = "Amol";
    .age = 25;
    .sal = 5500; 
}
With emp e
{
    .name = "Amol";
    .age = 25;
    .sal = 5500; 
}
e -> name = "Amol"; 
e -> age = 25;
e -> sal = 5500;
name = "Amol"; 
age = 25;
sal = 5500;
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.