This is the program that I have tried to make re evaluate values in an array. I can't really put my finger on what is wrong... Here is the code it generates some errors about the function but not very specific.
Good that you show the code and moreover, inside code tags, but you fail to explain what is wrong with this. What is the success criteria to be used when running/evaluating this code?
It has something to do with the functions not compatible with what they are used for... The problem is that I don't know exactly what the problem is :P
void show_array(constdouble *ar, double *end)
{
usingnamespace std;
while(at != end) // 1. You don't need to copy the pointer
// 2. Don't compare values but pointers instead
{
cout << "property #" << pt << ": ";
cout << *pt << endl;
++pt; // Same over here, dont use values but ptrs
}
}
void revalue(double r, double *ar, double *end)
{
while (ar != end) // Also here
{
*ar *= r; // You are multiplying the value I hope this is right
}
}
Thanks I am a mess when it comes to pointers!
I get this error along with some other errors:
4 IntelliSense: cannot overload functions distinguished by return type alone
I have used what you told me but even though it does compile there is something wrong making show_array only show the last number in the array then the rest is only crazy random numbers... :/ Doesn't fix everything