Thanks but no luck. The closest i'm getting is with one error. It doesn't recognize the .state part of populationArray.state. This is a struct array with elements inside the struct of course. Nothing is recognizing the elements in a sort. Once again, I appreciate your help I'm just a C# programmer not a C++ programmer. Now I've had to switch languages and its throwing me off.
I've tried Bubble Sorts and Selection sorts and even the a/b sort in the previous post to no avail.
int compare (data item1, data item2)
// returns -1 if item1 is "before" item2
// returns 0 if item1 and item2 have "equal" value regarding ordering
// returns 1 if item2 is "before" item1
// You'll have to decide the criteria for "equal" and "before"
void swap (data& item1, data& item2)
// swap values of each struct element of data1 and data2.
Then just do a bubble sort on the array like you would with a primitive type like an integer, only use these functions.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...