Hi,
Why I get access violation in this code ?
char *arr[ 5 ];
for( int i = 0; i < 5; i++ )
cin >> arr[ i ];
but not in this :
char *arr[ 5 ];
char list[ 5 ][ 30 ];
for( int i = 0; i < 5; i++ )
{
cin >> list[ i ];
arr[ i ] = list[ i ];
}
if arr is not accessible, so why in the second code I can access it ?