Modified to send
+- StateUtilities_LogN.c
This commit is contained in:
parent
7cebe82132
commit
cabae23450
1 changed files with 8 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue