I am trying to implement char array inside the struct Books. i have declared the char array public char[] b_id = new char[3] inside the struct. Now i want to access the b_id and initialize some value. how can it be done. Any suggestions? this is my present code.
namespace @struct
{
struct Books
{
public string title;
public char[] b_id = new char[3];
};
class Program
{
static void Main(string[] args)
{
Books Book1; /* Declare Book1 of type Book */
/* book 1 specification */
Book1.title = "C Programming";
/* print Book1 info */
Console.WriteLine("Book 1 title : {0}", Book1.title);
Console.ReadKey();
}
}
}