c++ - STL Algorithm for generating a vector -


I want to generate a vector using the STL algorithm to get the following

  Const int n1 = 10; // This is a content offset = 3; // also std :: vector & lt; Int & gt; Chans (10); For (size_t i = 0; i & lt; chans.size (); i ++) {chance [i] = offset + n1 * i; }  

Any suggestions?

14 with C ++:

  std :: generated (Chans.begin (), chans.end (), [=, calculation = 0] () instability {return offset + n1 * calculation ++;});  


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -