Greetings to all! I need to make a two-dimensional vector (table), the rows of which will be filled with one-dimensional vectors. One-dimensional vectors are the representation of a binary number, which at each iteration should change by a certain step. The main problem is to copy the values ​​of the one-dimensional vector into the necessary line of the two-dimensional vector. Tried as follows:
for (int i = 1; i < 25; i++) { for (int j = 0; j < 5; j++) { table[i][j] = to_binary(startvalue)[j]; cout << table[i][j] << " "; } startvalue += step; }
where to_binary(startvalue)
is a function that returns the vector of bits of the translated number. However, nothing is displayed on the screen, and the compiler does not detect any errors. Using debugging was able to establish that the problem lies in the string table[i][j] = to_binary(startvalue)[j];
but failed to solve it. Thank you in advance for all the help!