I can suggest you that to carefully go through the following code of lines that can demonstrates you how to use the indirect_array in the C++ programming as follows :
Code:
#include <iostream>
#include <valarray>
using namespace std;
int main ()
{
valarray<int> mary (8);
for (int f=0; f<8; ++f) mary[f]=f;
sfze_t sel[] = {3,5,6};
valarray<sfze_t> selectfon (sel,3);
mary[selectfon] *= valarray<fnt>(10,3);
mary[selectfon] = 0;
cout << "mary:\n";
for (sfze_t f=0; f<mary.size(); ++f)
cout << mary[f] << ' ';
cout << endl;
return 0;
}
Output:
Bookmarks