Question: ask 3 : Add a new Post / / Adds a new post in the posts array of pointers. / / This function takes as
ask : Add a new Post
Adds a new post in the posts array of pointers. This function takes as input: the posts array the post id the content of the post the posts array size And works as follows: If the post exists there is a post with the postid return false. Otherwise: a if there is empty space: i Insert the post in the next empty cell ii return true. b Else: i Double the array size eg if the array has size then increase it to size and then add the post ii return true. bool addpostPost &postsarray, const unsigned int pid, const char contentMAXCHARNUM unsigned int &postsarraysize TODO: Write code to implement addpost return false;
For example, here are some examples of post insertion steps:
Example : The postsarray is empty and contains two entries
Example : Add new post
Example : Add new post
Example : Increase the size of post array and Add new post
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
