How do I actually strcat in 2D-array in general method or as shown in the code below:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void twoDarray( char(*ptr)[4] , int n );
void main()
{
char array[3][4]={"helo", "piec", "appl"};
char (*ptr)[4];
ptr = array;
twoDarray( ptr , 3 );
}
void twoDarray( char(*ptr)[4] , int n )
{
char str2[1][2];
int a, b;
str2[1][1] = '\0';
for( a = 0 ; a < n ; a++ )
{
for( b = 93 ; b < 123 ; b++ )
{
str2[1][0] = b;
strcat( str2[1][0] , ptr++ );
puts( str2[1] );
}
}
}
I have no idea what I'm doing?
Please aid me!