#include <iostream>
#include <array>
#include <utility>
std::pair< std::array<int,3>, std::array<char,4> > array_function()
{
//does alot of maths here
std::array<int,3> numbers = { 1, 2, 3 } ;
std::array<char,4> letters = { 't', 'y', 'u', 'w' } ;
//return both arrays
return { numbers, letters } ;
}
int main()
{
auto p = array_function() ;
auto int_array = p.first ;
for( int i : int_array ) std::cout << i << ' ' ;
std::cout << '\n' ;
auto char_array = p.second ;
for( char c : char_array ) std::cout << c ;
std::cout << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YXJyYXk+CiNpbmNsdWRlIDx1dGlsaXR5PgoKc3RkOjpwYWlyPCBzdGQ6OmFycmF5PGludCwzPiwgc3RkOjphcnJheTxjaGFyLDQ+ID4gYXJyYXlfZnVuY3Rpb24oKQp7CiAgIC8vZG9lcyBhbG90IG9mIG1hdGhzIGhlcmUKICAgc3RkOjphcnJheTxpbnQsMz4gbnVtYmVycyA9IHsgMSwgMiwgMyB9IDsKICAgc3RkOjphcnJheTxjaGFyLDQ+IGxldHRlcnMgPSB7ICd0JywgJ3knLCAndScsICd3JyB9IDsKCiAgIC8vcmV0dXJuIGJvdGggYXJyYXlzCiAgIHJldHVybiB7IG51bWJlcnMsIGxldHRlcnMgfSA7Cn0KCmludCBtYWluKCkKewogICAgYXV0byBwID0gYXJyYXlfZnVuY3Rpb24oKSA7CgogICAgYXV0byBpbnRfYXJyYXkgPSBwLmZpcnN0IDsKICAgIGZvciggaW50IGkgOiBpbnRfYXJyYXkgKSBzdGQ6OmNvdXQgPDwgaSA8PCAnICcgOwogICAgc3RkOjpjb3V0IDw8ICdcbicgOwoKICAgIGF1dG8gY2hhcl9hcnJheSA9IHAuc2Vjb25kIDsKICAgIGZvciggY2hhciBjIDogY2hhcl9hcnJheSApIHN0ZDo6Y291dCA8PCBjIDsKICAgIHN0ZDo6Y291dCA8PCAnXG4nIDsKfQo=