Thanks kmdv!
Following your suggestion
vec_th.at(ithresh).at(ichan).at(ipos);
gives me
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check
Type: Posts; User: fclopez
Thanks kmdv!
Following your suggestion
vec_th.at(ithresh).at(ichan).at(ipos);
gives me
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check
Thanks!
I am using my actual code. Say I would like to access what I just pushed back....
for(int ithresh=th_begin; ithresh<th_end+th_interval; ithresh = ithresh+th_interval) {
...
int iMax=50;
int jMax = 20;
const int kMax = 10;
int x =5;
int y;
vector<vector<vector<int>>> someVector(kMax); //no complains here
for (int i =0; i<iMax; i++) {
for(int j = 0;...
int iMax=50;
int jMax = 20;
const int kMax = 10;
int x =5;
int y;
vector<int> someVector[kMax]; // my problem is here....I want to create an array of array of vectors. How does one declare...
I want to complicate the story some more. How does one write an array of array of vectors. Many thanks for the help!
F.
Thanks for the comprehensive suggestions.
How does one access an nth element of a vector in the array of vectors?
//say 100th element of ivector = 5
someVector[5][100]; // is this correct?
ok, consider the picture
float x = 50.;
float y;
for(int ivector = 0; ivector<20; ivector++) {
vector<float> someVector_%d //my problem lies here
/* here i want to generate 20...
my only problem is to concatenate someVector_ with the integer in the for-loop, so that for instance I produce someVector_0
I would like to produce five vectors via for-loop
for(int i =0; i<5; i++) {
vector<float> someVector_%d ;
}
so that i have
I would like to concatenate strings and integers so that i produce something like this:
char *path " = "/home/myFolder%d/run%d.raw"
//where %d is a integer specifier
so that I can use it...
Thanks Jim.
Thanks for pointing out the mistake in ext[].
someFunction is part of a bigger for-loop so that when someFunction is called, it will do some more complicated for-loops. The idea is, I...
I have a very simple question. I would like to concatenate strings so that
char *string0 = "/home/myComputer/someFolder/fileName_";
char ext[4] = ".raw";
char fname[256];
int someNumber;
...