Answer the question
In order to leave comments, you need to log in
Is it possible to shorten this cycle?
is it possible to shorten this cycle?
std::vector<std::string> vec_s = { "a", "b", "c" };
for(int index_vec_s = 0; index_vec_s <= vec_s.size() - 1; index_vec_s++)
//std::cout для примера// std::cout << vec_s[index_vec_s].data() << std::endl;
Answer the question
In order to leave comments, you need to log in
using namespace std;
for(const auto& i:vec_s)
{
cout << i << '\n'; //выводим \n чтобы не сбрасывать буфер терминала на каждой строке
}
cout << flush;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question