2.8k views
4 votes
// PrintStrings // Traverse the 2D character array "strings" and print each of the contained strings.// See the example outputs provided in the word document. Your output should match the example outputs.void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]){}

1 Answer

2 votes

Answer:

C++.

Step-by-step explanation:

void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) {

// Multi dimension array can be traversed through multi-level loops

for (int i = 0; i < NUM_STRINGS; i++) {

for (int j = 0; j < STRING_LENGTH; j++) {

cout<<"<<strings[i][j]<<";

}

cout<<endl;

}

}

Output would be like this, depending on the size of NUM_STRINGS;

"One"

"Two"

"Three"

....

User Luke West
by
5.8k points