how to initialize Empty array in stuct [Solidity]

how to initialize Empty array in stuct [Solidity]

I am suffering to initialize an empty array for struct when a struct is made.

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

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Adding Messages On The Bitcoin Blockchain - A How-To Guide

Can I write on a Bitcoin Blockchain? Can I drop down a message? Yes, Luca of course you can! You can leave a message on a Bitcoin blockchain using a particular op code, called OP_RETURN.

What Is The Difference Between Blockchain And Bitcoin?

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects

Learning Solidity

Solidity is a high-level language used to implement smart contracts. This is an object oriented language designed to target the Ethereum Virtual Machine. Let's explore it!

What Is The Difference Between Blockchain And Bitcoin?

Get hands on experinece on block chain live industry experts with real world example at Block chain online Training. Enroll for free demo

The Future Of Blockchain Technology And Cryptocurrency Applications

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects