Outils pour utilisateurs

Outils du site


lang:cpp:container

Ceci est une ancienne révision du document !


Différence entre les conteneurs

Conteneur Mémoire contiguë
vector Oui
array Oui
deque Non
list Non
forward_list Non
stack Non
queue Non
priority_queue Dépend

Choosing the Right Container: Sequential Containers Archive du 09/09/2019 le 13/11/2019

std::string et std::array

  • std::array to std::string
std::string str(std::begin(arr), std::end(arr));
  • std::string to std::array
std::string toto("tototototototo1234");
std::array<char, 16> arr{};
std::copy_n(toto.begin(), std::min(toto.length(), static_cast<size_t>(16)), arr.data());
lang/cpp/container.1576707166.txt.gz · Dernière modification : 2019/12/18 23:12 de root