Write whole struc | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 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);

20th Jan 2017, 8:54 AM
MStar
MStar - avatar
1 Respuesta
+ 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); 👍
29th Jan 2017, 11:13 AM
Jafca
Jafca - avatar