C# Programming - Structures - Discussion

Discussion :: 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();

[A].
e.name = "Amol"; 
e.age = 25; 
e.sal = 5500;
[B].
With e
{
    .name = "Amol";
    .age = 25;
    .sal = 5500; 
}
[C].
With emp e
{
    .name = "Amol";
    .age = 25;
    .sal = 5500; 
}
[D].
e -> name = "Amol"; 
e -> age = 25;
e -> sal = 5500;
[E].
name = "Amol"; 
age = 25;
sal = 5500;

Answer: Option A

Explanation:

No answer description available for this question.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.