arrays


how to make a variable that take subset from another variable which is an array ?
a) Define "take"

b) Use std::vector instead of plain arrays.
You can also declare it as an array if the size of the subset is known at compile time. Or you can dynamically allocate the array. Or you can use some sort of container.
Last edited on
1
2
int a [2] = {1, 2};
int b = a [1];
;
Last edited on
Topic archived. No new replies allowed.