Jan 21, 2014 at 12:33pm UTC
You're adding an extra parenthesis.m_sampleHash.insert(1, new std::vector<double >(SCOPEPLOT_MAXNUM_SAMPLES) );
Fix:
m_sampleHash.insert(1, new std::vector<double >(SCOPEPLOT_MAXNUM_SAMPLES);
Jan 21, 2014 at 12:50pm UTC
Extra Parenthesis Means
m_sampleHash.insert(1, new std::vector<double>(SCOPEPLOT_MAXNUM_SAMPLES);
This will give me a Compile time Error.
I don't know how you suggested this Answer...
Jan 21, 2014 at 1:31pm UTC
Why are you using SCOPEPLOT_MAXNUM_SAMPLES at all?
1 2 3 4 5 6 7 8 9 10 11 12
#define SCOPEPLOT_MAXNUM_SAMPLES (1000000)
QHash<int , std::vector<double >*> m_sampleHash;
m_sampleHash.insert(1, new std::vector<double >());
// ...
std::vector<double >* vec_p = m_sampleHash.value(1);
vec_p->resize(numSamples);
for (int k = 0; k < numSamples; k++)
{
count++;
(*vec_p)[k] = data_p[k];
}
Last edited on Jan 21, 2014 at 1:32pm UTC
Jan 21, 2014 at 3:23pm UTC
apart from what kbw wrote i don't see anything within your code snippet that could cause a crash
Jan 21, 2014 at 7:09pm UTC
Oh >_> I didn't see that. Sorry.
It seems as this is the suspect:
for (int k = 0;k < numSamples;k++)
What's your full code? Are you initializing numSamples?