diff --git a/PA03-0920/StateUtilities_LogN.c b/PA03-0920/StateUtilities_LogN.c index 92effa9..be94d63 100644 --- a/PA03-0920/StateUtilities_LogN.c +++ b/PA03-0920/StateUtilities_LogN.c @@ -33,21 +33,21 @@ void addElementFromData( StateArrayType *stateArr, double stateGrowth, char politicalMajority ) { printf("\nAdding Element(from data)\n"); - printf("\nSize is: %d\n", &stateArr->size); - printf("\nCapacity is: %d\n", &stateArr->capacity); + printf("\nSize is: %d\n", stateArr.size); + printf("\nCapacity is: %d\n", stateArr.capacity); // check to see if the size will go over the capacity - if(&stateArr->size < &stateArr->capacity) + if(stateArr.size < stateArr.capacity) { printf("\nInside IF\n"); // put in the data to the array // stateArr->array[stateArr.size] = parameter - stateArr->array[&stateArr->size].population = statePop; - stateArr->array[&stateArr->size].growth = stateGrowth; - stateArr->array[&stateArr->size].majority = politicalMajority; + stateArr->array[stateArr.size].population = statePop; + stateArr->array[stateArr.size].growth = stateGrowth; + stateArr->array[stateArr.size].majority = politicalMajority; // use strcpy(stateArr->array[stateArr.size].name, stateName) - strcpy(stateArr->array[&stateArr->size].name, stateName); + strcpy(stateArr->array[stateArr.size].name, stateName); // increment size (stateArr.size = stateArr.size + 1) - &stateArr->size = &stateArr->size + 1; + stateArr->size = stateArr->size + 1; printf("\nDONE IF\n"); } // no return, void