I'm getting a segmentation fault whenever I try to print out the line shown in the "push" function. If I remove the [d->data3] from d->data1[d->data3] and just leave it as d->data1, I get the correct output. But regardless, why doesn't d->data1[d->data3] work, and gives me a segmentation fault? Was my dynamic array not properly allocated?
d->data1[d->data3] is a char, but your printf uses %s, which expects a pointer to a null terminated string. Change line 20 to: printf("The character in data1: %c\n", d->data1[d->data3]);