Though some complilers supports its own language extensions nevertheless variable length arrays
cin>>n;
char a [n][50];
int arr [n][50];
is not a standard C++ feature. So instead them it is better to use the standard container std::vector
.
It seems in this statement
arr[i][50]=a[i][50];
you are trying to assign one array to another array. Apart from the expressions are incorrect arrays do not have the assignment operator.
Below is a demonstrative program that shows how to perform your task.
#include <iostream>
#include <string>
#include <limits>
#include <array>
#include <vector>
#include <iterator>
#include <algorithm>
#include <cstring>
int main()
{
const size_t N = 50;
std::cout << "Enter the number of strings: ";
size_t n;
std::cin >> n;
std::vector<std::array<char, N>> strings( n );
std::vector<std::array<int, N>> values( n );
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
for ( size_t i = 0; i < strings.size(); i++ )
{
std::cin.getline( strings[i].data(), N, '\n' );
}
for ( size_t i = 0; i < strings.size(); i++ )
{
std::cout << strings[i].data() << '\n';
}
for ( size_t i = 0; i < strings.size(); i++ )
{
size_t len = std::strlen( strings[i].data() ) + 1;
std::copy( strings[i].data(), strings[i].data() + len, std::begin( values[i] ) );
}
for ( const auto &row : values )
{
for ( auto it = std::begin( row ); *it != 0; ++it )
{
std::cout << *it << ' ';
}
std::cout << '\n';
}
return 0;
}
The program output might look the following way
Enter the number of strings: 2
Hello
World
72 101 108 108 111
87 111 114 108 100