Jan 5, 2011 at 12:33am UTC
qsasa
Last edited on Feb 17, 2011 at 11:23pm UTC
Jan 5, 2011 at 12:34am UTC
sasa
Last edited on Jan 7, 2011 at 3:04pm UTC
Jan 5, 2011 at 12:51am UTC
What exactly is going wrong? What are the possible solutions, that you are aware of? I think by the forum's rules, you are required to give a bit more information on what you need, seeing how this appears to be homework.
Jan 5, 2011 at 1:03am UTC
Indeed, especially considering most people don't really want to wade through two posts worth of code to find errors.
Jan 5, 2011 at 2:16am UTC
ijkl
Last edited on Feb 17, 2011 at 11:20pm UTC
Jan 6, 2011 at 6:32am UTC
Check your ShowValue values in the following they are both forced to false. Apply Filter was not even accessed.
You may need to rethink that or finish the logic.
TheFilter::ShowValue_Valid()
TheData::ShowValue_Valid()
I commented the two condition checks and the ApplyFilter ran fine
The input data values
---------------------
[ 1 2 3 4 5 ]
The data output values
----------------------
[ 5 8 11 14 ]
The filter values
-----------------
[ 1 2 ]
To output I just changed your for loops:
1 2 3 4
for (unsigned long CountData = 0; CountData < OriginalData.Length; CountData++)
{
cout << " " << OriginalData.Values[CountData];
}
1 2 3 4
for (unsigned long CountData = 0; CountData < FilteredData.Length; CountData++)
{
cout << " " << FilteredData.Values[CountData];
}
1 2 3 4
for (unsigned long CountData = 0; CountData < Filter.Length; CountData++)
{
cout << " " << Filter.Values[CountData];
}
Last edited on Jan 6, 2011 at 6:39am UTC
Jan 6, 2011 at 12:19pm UTC
khj
Last edited on Feb 17, 2011 at 11:20pm UTC
Jan 7, 2011 at 3:31am UTC
Don't worry sometimes you have to take a step back.
Add breakpoints and output variables to help you troubleshoot problem code.
Learn using the debugger. If you use an IDE, you can add checkpoints and watchpoints to help.