cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
arrays
arrays
Jun 2, 2013 at 3:56pm UTC
Mohamed 2013
(1)
how to make a variable that take subset from another variable which is an array ?
Jun 2, 2013 at 4:01pm UTC
keskiverto
(10402)
a) Define "take"
b) Use std::vector instead of plain arrays.
Jun 2, 2013 at 4:01pm UTC
vlad from moscow
(6539)
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 UTC
Jun 2, 2013 at 4:02pm UTC
pogrady
(677)
1
2
int
a [2] = {1, 2};
int
b = a [1];
;
Last edited on
Jun 2, 2013 at 4:02pm UTC
Topic archived. No new replies allowed.