Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Boost 1.73.0
C++2a
no pedantic

›
99
1
2
3
4
5
6
7
8
9
10
#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