Yes I got it! I subtracted array[0] which is the first! Thank you! Need to do the elmo dance. nadroj rocks!
Type: Posts; User: musique
Yes I got it! I subtracted array[0] which is the first! Thank you! Need to do the elmo dance. nadroj rocks!
sorry, I made an error there, this is what it is now...
/***This program dynamically allocates an array large enough to
hold a user-defined number of test scores***/
#include <iostream>...
Hmmm, let me try it and see, thanks for your help anon.
This is my full program as it is now...the last function is to remove a student's lowest testscore and then calculate an average, I am thinking that I should compare the testscores to find the lowest...
Yes I did (assuming I did it right), I changed it to...
double average(int array[], int numts)
{
int total = 0;
int lowest = 0;
double avg;
I believe I see what you are saying...But before, when I had no zero, I was getting a warning that lowest wasn't initialized? What else can I initialize zero with?
I am new to c++, but I understand what you guys mean concerning the initialization...I changed it to...still not working though, see any other errors in it?
double average(int array[], int...
Thank you, it took away the warning but it is still not working, do you know why? I am trying to get the average of the test scores after removing the lowest value.
Why is this function not working? Sigh...I am getting a warning....warning C4700: local variable 'lowest' used without having been initialized...but I did initialize it at the start...
...
If it is an integer you want to return, then change the void to int. Change the data type of the function declaration.
I was told in order to understand pointers I should try to use it instead of arrays. I don't understand pointers so in order to see how they function I was trying to alter my currently working...
Yup, I just tried moving the show array function to see if it just was not displaying and it was just that, it is working just was not being displayed, thanks. I just need to add pointers to it now,...
Thank you for the reply anon. I tried it but it didn't work. Should incorporate pointers?
Thanks for the reply ben10 but what do you mean? As in array [count]?
Why is my sorting function not working?
void sort(int array[], int numts)
{
int lowIndex, lowest;
for (int count = 0; count < (numts-1); count++)
{
Thanks bithub, I would work on my input validation as well.
Thank you, but I am not sure if I fully understand the concept for that, I am assuming that you meant that these two function calls are incorrect:
showArray (testscores, numts);
sort...
I need help with pointers, I am getting the following error:
error C2664: 'showArray' : cannot convert parameter 1 from 'int *' to 'int *[]' for both of these functions:
void sort(int *[],...
the sorting function I added was:
void selectsort(int testscores[][numcol], int size)
{
int startscan, lowindex;
int lowts;
I was able to get the 20 values of the first column to show now but just need the to get the values in the second column to be displayed, then I could continue adding to it.
I understand, you have a point, thanks for your help...I just changed it to the following code but still not seeing the data in the file
void getts(int testscores[][numcol], int size)
{...
Can anyone tell me what is wrong with my program? It is not reading the data from the file...
//This program is....
#include <iostream>
#include <iomanip>
#include <fstream>
using...