Not too sure what you are getting at, but I'll give it another go...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define ELEMS 5
#define ELEMS_X 20
int main( void )
{
int i;
char matrix[ELEMS][ELEMS_X];
char* aOfp[ELEMS];
char* aOfs[ELEMS]={ "One",
"Two",
"Three",
"Four",
"Five"
};
for( i=0;i<ELEMS;i++ )
strcpy( matrix,aOfs );
for( i=0;i<ELEMS;i++ )
aOfp=matrix;
for( i=0;i<ELEMS;i++ )
{
printf( "%c - ",aOfp[0] );
printf( "%s\n",aOfp );
}
return 0;
}
1. The first for loop inserts the strings into a 2d array.
2.The second loop sets an array of char pointers to point to each string in matrix[][]
3.The last loop prints out the first char and the entire string via the array of pointers. Mike L.G.
mlg400@linuxmail.org