#include <iostream>
#include <string>
#include <memory>
int main()
{
const int COLS = 5 ;
// using row_type = std::string[COLS] ; // ***
typedef std::string row_type[COLS] ; // ***
std::size_t rows ;
std::cout << "rows? " ;
std::cin >> rows ;
{
row_type* array = new row_type[rows] ;
// use array
for( std::size_t i = 0 ; i < rows ; ++i )
for( std::size_t j = 0 ; j < COLS ; ++j )
array[i][j] = "hello" ;
for( std::size_t i = 0 ; i < rows ; ++i )
{
for( std::size_t j = 0 ; j < COLS ; ++j )
std::cout << array[i][j] << ' ' ;
std::cout << '\n' ;
}
delete[] array ;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8bWVtb3J5PgogCmludCBtYWluKCkKewogICAgY29uc3QgaW50IENPTFMgPSA1IDsKICAgIC8vIHVzaW5nIHJvd190eXBlID0gc3RkOjpzdHJpbmdbQ09MU10gOyAvLyAqKioKICAgIHR5cGVkZWYgc3RkOjpzdHJpbmcgcm93X3R5cGVbQ09MU10gOyAvLyAqKioKIAogICAgc3RkOjpzaXplX3Qgcm93cyA7CiAgICBzdGQ6OmNvdXQgPDwgInJvd3M/ICIgOwogICAgc3RkOjpjaW4gPj4gcm93cyA7CiAKICAgIHsKICAgICAgICByb3dfdHlwZSogYXJyYXkgPSBuZXcgcm93X3R5cGVbcm93c10gOwogCiAgICAgICAgLy8gdXNlIGFycmF5CiAgICAgICAgZm9yKCBzdGQ6OnNpemVfdCBpID0gMCA7IGkgPCByb3dzIDsgKytpICkKICAgICAgICAgICAgZm9yKCBzdGQ6OnNpemVfdCBqID0gMCA7IGogPCBDT0xTIDsgKytqICkKICAgICAgICAgICAgICAgIGFycmF5W2ldW2pdID0gImhlbGxvIiA7CiAKICAgICAgICBmb3IoIHN0ZDo6c2l6ZV90IGkgPSAwIDsgaSA8IHJvd3MgOyArK2kgKQogICAgICAgIHsKICAgICAgICAgICAgZm9yKCBzdGQ6OnNpemVfdCBqID0gMCA7IGogPCBDT0xTIDsgKytqICkKICAgICAgICAgICAgICAgIHN0ZDo6Y291dCA8PCBhcnJheVtpXVtqXSA8PCAnICcgOwogICAgICAgICAgICBzdGQ6OmNvdXQgPDwgJ1xuJyA7CiAgICAgICAgfQogCiAgICAgICAgZGVsZXRlW10gYXJyYXkgOwogICAgfQp9Cg==