How to create a row vector with elements from 0 up to and including N in C++? [duplicate]
问题 This question already has answers here : use std::fill to populate vector with increasing numbers (14 answers) Closed 3 years ago . I would like to create a row vector in C++ with integer elements from and including 0 to N (an integer variable I assign in my C++ program). I have seen the Armadillo C++ library and tried using its span function but it does not create a vector (rather creates an object with type arma::span ) so writing: vec n = span(0,N); does not create the desired vector. If