+ 2
Write whole struc
Is it possible to get all members of struct or write all members of struct? For example: one member - Console.WriteLine(b.title); struct - Console.WriteLine(b);
1 Resposta
+ 4
You could create a method:
void structDisplay(myStruct b)
{
Console.WriteLine(b.title);
//a Console.WriteLine for each data member of the struct
}
structDisplay(b);
👍