Forum: C++ Jan 7th, 2008 |
| Replies: 3 Views: 2,805 Writing an array-sorting algorithm has been the bane of intro-C++ courses since the language was invented, I think. Being a hobbyist, I try to avoid having to sort. If you just need the max and min,... |
Forum: C++ Jan 7th, 2008 |
| Replies: 3 Views: 2,805 What I would do is this instead of the "read" loop:
int tmax, tmin;
tmax=temp[0];
tmin=temp[0];
for(int i=0; i<31; i++){
if(temp[i]>tmax){
tmax=temp[i]; |