I am suffering to initialize an empty array for struct when a struct is made.
pragma solidity ^0.5.1;contract Board {
//storage Post[] posts; //struct struct Post { address author; string title; string content; Comment[] comments; } struct Comment { address author; string comment; } //add-post function addPost(address _author, string memory _title, string memory _content) public { posts.push(Post(_author, _title, _content, /* HERE IS THE PROBLEM POINT */)); }
}
I want to initialize the comments(struct member) with Empty Array(Type: Comment). Which code should I use for The Problem Point??
#solidity #blockchain #bitcoin #cryptocurrency #altcoins