I'm trying this code:
private List<book> books;
//private book[] books;
.
.
.
private void button1_Click(object sender, EventArgs e)
{
books.Add(new book(book_name.Text));
//book[0]=new book(book_name.Text);
}
but I'm getting this error:
'Object reference not set to an instance of an object.'
What should I do? I want dynamic creation of object by an event.