arrays

Jun 2, 2013 at 3:56pm

how to make a variable that take subset from another variable which is an array ?
Jun 2, 2013 at 4:01pm
a) Define "take"

b) Use std::vector instead of plain arrays.
Jun 2, 2013 at 4:01pm
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 Jun 2, 2013 at 4:01pm
Jun 2, 2013 at 4:02pm
1
2
int a [2] = {1, 2};
int b = a [1];
;
Last edited on Jun 2, 2013 at 4:02pm
Topic archived. No new replies allowed.