hi,
i need some help with resolving the following problem. What i have is a structure in which i have a pointer to the character array. on the other hand i have a string array like this:
Code:
typedef struct tmp{
char *array1;
}TMP;
int main(){
char *array2 = "mystring";
}
what i need to do is to make the array1 an array of pointers such that when i iterate over them like this :
Code:
for (i=0;i<=n;i++){
printf("%s\n",TMP->array1[i]);
}
i get the result:
Code:
mystring
ystring
string
tring
ring
ing
ng
g
How would i do this, could anyone provide an example ??
thank you
baxy