--- In [email protected], "Victor A. Wagner Jr." <[EMAIL PROTECTED]>
Opps I forgot to remove the asterics I still can't figure out the
lenght of the array though.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char *arr1[] = {"john", "paul", "ringo"};
char *arr2[] = {"apple", "oranges"};
char **arr3[] = {arr1, arr2};
printf("name: %s\n",arr3[0][1]);
printf("arr size is %d\n",sizeof(arr3[0][0])/sizeof(char *));
system("PAUSE");
return 0;
}
wrote:
>
> At 15:48 2007-03-26, mr_gees100_peas wrote:
> >Hi,
> >
> > I have the following string arrays.
> >
> >char *arr1[] = {"john", "paul", "ringo"};
> >char *arr2[] = {"apple", "oranges"};
> >
> >char *arr3[] = {*arr1, *arr2};
> >
> >What I want to do is access the content of arrays 1 and 2 inside of
> >array 3. How do I go about this? And no I can't use a two dimensional
> >array.
>
> that's a very common way to create a 2D array, so you're using one
> whether you want or not.
> iirc, arr3[0][1] will be "paul"
>
> now for the problems... you have NO way of knowing (inside your
> program) how many elements are in arr3[0] and arr3[1] which means you
> can't tell that there are 3 Beatles and 2 fruits.
>
>
>
>
> >To unsubscribe, send a blank message to
> ><mailto:[EMAIL PROTECTED]>.
> >Yahoo! Groups Links
> >
> >
> >
>
> Victor A. Wagner Jr. http://rudbek.com
> The five most dangerous words in the English language:
> "There oughta be a law"
>