Language
C++
Compiler
gcc 10.1.0
Options
Warnings
Boost 1.73.0
C++2a
no pedantic
#include <iostream>
#include <vector>
int main(){
const char* pstr = "abcdef"; // 配列
std::vector<const char*> vstr; // ベクター配列
for (int i=0; i<5; i++)vstr.push_back(pstr);
for(const auto& i:vstr)std::cout << i << std::endl;
}
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=c++2a
abcdef
abcdef
abcdef
abcdef
abcdef
Exit Code:
0