diff options
Diffstat (limited to 'count_vowel_string_range.c')
-rw-r--r-- | count_vowel_string_range.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/count_vowel_string_range.c b/count_vowel_string_range.c index 57eda96..550ce90 100644 --- a/count_vowel_string_range.c +++ b/count_vowel_string_range.c @@ -37,13 +37,12 @@ int main() { char *w1[] = {"aba", "bcb", "ece", "aa", "e"}, *w2[] = {"a", "e", "i"}; int q1i[3][2] = {{0, 2}, {1, 4}, {1, 1}}, rs1; int q2i[3][2] = {{0, 2}, {0, 1}, {2, 2}}, rs2; - struct two_d_arr q1, q2; - two_d_arr_init(&q1, 3, 2, q1i); - two_d_arr_init(&q2, 3, 2, q2i); - int *vs1 = vowelStrings((char **)w1, ARRAY_SIZE(w1), q1.arr, q1.row_size, - q1.col_size, &rs1); - int *vs2 = vowelStrings((char **)w2, ARRAY_SIZE(w2), q2.arr, q2.row_size, - q2.col_size, &rs2); + struct two_d_arr *q1 = two_d_arr_init(3, 2, q1i); + struct two_d_arr *q2 = two_d_arr_init(3, 2, q2i); + int *vs1 = vowelStrings((char **)w1, ARRAY_SIZE(w1), q1->arr, q1->row_size, + q1->col_size, &rs1); + int *vs2 = vowelStrings((char **)w2, ARRAY_SIZE(w2), q2->arr, q2->row_size, + q2->col_size, &rs2); for (int i = 0; i < rs1; i++) printf("%d ", vs1[i]); // expect: 2 3 0 printf("\n"); @@ -51,5 +50,6 @@ int main() { printf("%d ", vs2[i]); // expect: 3 2 1 printf("\n"); free(vs1), free(vs2); - two_d_arr_free(&q1), two_d_arr_free(&q2); + two_d_arr_free(q1); + two_d_arr_free(q2); } |