Update
This commit is contained in:
1 parent
0f6b99c03a
commit
ae972c6cbb
1 file changed
+9
-1
+9
-1
@@ -28,13 +28,21 @@ int main(void)
|
||||
printf("\n");
|
||||
|
||||
// Now, display the list backwards
|
||||
printf("List backwards: ");
|
||||
printf("Array backwards: ");
|
||||
for (array_charp_previous (itr) ; !array_charp_end_p (itr); array_charp_previous(itr)) {
|
||||
char *element = *array_charp_ref(itr);
|
||||
printf ("%s ", element);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
// For array, we can also iterate over the integer
|
||||
printf("Array Direct: ");
|
||||
for(size_t i = 0 ; i < array_charp_size(al); ++i) {
|
||||
char *element = *array_charp_get(al, i);
|
||||
printf ("%s ", element);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
// Clear the array
|
||||
array_charp_clear(al);
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user