Long time troll, first time poster... I have some problems understanding arrays containing pointers. Take this fragment for example:
Code:
        char *a[3];
	char d[50] = {'a', 'b', 'c'};

	*(*(a + 0) + 0) = *(d + 0);
	*(*(a + 0) + 1) = *(d + 1);
	*(*(a + 0) + 2) = *(d + 2);
	*(*(a + 0) + 3) = *(d + 3);

        printf("%c",*(*(a + 0) + 0));
	printf("%c",*(*(a + 0) + 1));
	printf("%c",*(*(a + 0) + 2));
Which should print out "abc" without the quotes... The following explanation is shody at best so please bare with me...

From what I understand, array 'a' contains three members of type pointer to a char array. The actual data contained in these 3 memory adresses are actually of type int, where an int represent the address of the actual char array. So take for example the line *(*(a + 0) + 0) = *(d + 0); ...
Starting from the innermost parentheses, the code states--
#1. (a + 0)..... take the starting memory adress of a, that is a[0], and add this to sizeof(type) multiplied by 0... So I am at the level of a[0] which once again contains a pointer to the first element of char array
#2. *(a + 0) + 0..... Now take what a[0] points to, which is the starting address of the first char array, and deference the value, which should now give me the starting address of the single character at the beginning of the char array. Thus *(a + 0) + 1 should be the address of the second member of the char array and so on
#3. *(*(a + 0) + 0) = *(d + 0)..... Finally, deference the address of the char array and give me it's value, which should be of type char, and assign d[i] as it's value;

Now the above only works if I add nothing else to the program, that is-- when i try this with reading lines of text from a file all hell breaks loose. I suspect my pointer arithmetic and logic as detailed above is flawed. If i had to guess, I would say since I did not specify the array size when i declared the variable, the array only contains one single member, so adding sucessive members to char array will work in very limited situations and through side effects -- That is, I am printing the values from beyond my array but since there was nothing there and nothing will go in that address I got away with it.

Now you can probably guess what I am trying to do here...
Code:
        char *a[3];
	char *b[3];
	char *c[3];
	
	char **all[3] = {a,b,c};
So with one line of code, say *(*(*(all + 1) + 2) + 10), I can tell the program to put whatever data into the 11th character position of array *b[2]. What seemed so simple at first really has me scratching my head. Any corrections to my faulty logic/ suggestions would be appreciated. Thank you.