Implement the function void Build_A_List(Str30 dest[], Str30 source [][COLSIZE], int length, int *pCount) which will copy all strings with a string length equal to parameter length. The function should also update *pCount which will store the number of strings copied from source[][] to dest[] array. Code format TO DO #3: Implement function Build_A_List(). DO NOT use printf() in the function definition. */ void Build_A_List(Str30 dest[], Str30 source[][COLSIZE], int length, int *pCount) { // write code here } */
I need help in this question in C program.
Consider a 2D array of strings based on the following declarations/definitions:
#define ROWSIZE 4
#define COLSIZE 3
typedef char Str30[31];
Str30 Words[ROWSIZE][COLSIZE]; // 2D array of string
An example Words[ ][ ] array is shown below.
col0 | col1 | col2 | |
row0 | dOg | Neko | Cat |
row1 | Hello | gOoDbYE | WELCOME |
row2 | GREEN | CauliFlower | Blue |
row3 | Code | Programmer | SynTaX |
Implement the function void Build_A_List(Str30 dest[], Str30 source [][COLSIZE], int length, int *pCount) which will copy all strings with a string length equal to parameter length. The function should also update *pCount which will store the number of strings copied from source[][] to dest[] array.
Code format
TO DO #3: Implement function Build_A_List().
DO NOT use printf() in the function definition.
*/
void Build_A_List(Str30 dest[], Str30 source[][COLSIZE], int length, int *pCount)
{
// write code here
}
*/
Example #1: Build_A_List(dest, Words, 4, &count); // where Str30 dest[MAXSIZE * COLSIZE]
The resulting dest[] array that contains all the words with a string length of 4 copied in row major order is shown below. The value
of count = 3
Neko |
Blue |
code |
Example #2: Build_A_List(dest, Words, 88, &count);
The resulting dest[] array will not contain any word since there is no word in source[][] that has a string length of 88. The value of count = 0.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)