making arrays of pointers with pointers..... 
Author Message
 making arrays of pointers with pointers.....

Quote:

>I have a little problem..

>I just can't make this line with pointers:

>char *test[4];

>...... I now how I make arrays of chars with pointers.. but not how to
>make an array of pointers to chars with pointers.. anyone who could
>help me?

You can't make arrays with pointers in C, you can only use pointers to refer
to existing arrays. In your example above you have an array of 4 pointers
to char. You need to set each of those pointers to point into a suitable
array of char before you can use them.

I suggest that you take a step back and explain in more general terms
what you want to do, preferably without using terms such as 'pointer',
perhaps give an example.

Quote:
>(please don't post the answer here... mail it to me instead...)

That's not how Usenet works - if you post the question here you read the
answer here so that others can benefit from the answer. Also you benefit
because if the responder is talking rubbish this is quickly pointed out.

--
-----------------------------------------


-----------------------------------------



Fri, 16 Apr 1999 03:00:00 GMT  
 making arrays of pointers with pointers.....

I have a little problem..

I just can't make this line with pointers:

char *test[4];

...... I now how I make arrays of chars with pointers.. but not how to
make an array of pointers to chars with pointers.. anyone who could
help me?

(please don't post the answer here... mail it to me instead...)

thank you in advance!

---
Rune Elvemo

http://www.sn.no/~elvemo



Fri, 16 Apr 1999 03:00:00 GMT  
 making arrays of pointers with pointers.....

Would

        char test[4][4];

help?

--

The compiler errors always remind me that I am human.



Quote:
> I have a little problem..

> I just can't make this line with pointers:

> char *test[4];

> ...... I now how I make arrays of chars with pointers.. but not how to
> make an array of pointers to chars with pointers.. anyone who could
> help me?

> (please don't post the answer here... mail it to me instead...)

> thank you in advance!

> ---
> Rune Elvemo

> http://www.sn.no/~elvemo



Sat, 17 Apr 1999 03:00:00 GMT  
 making arrays of pointers with pointers.....

Quote:

> I have a little problem..
> I just can't make this line with pointers:
> char *test[4];
> ...... I now how I make arrays of chars with pointers.. but not how to
> make an array of pointers to chars with pointers.. anyone who could
> help me?

<No answer given>

Quote:
> (please don't post the answer here... mail it to me instead...)

Post here means read answer here.

Quote:
> thank you in advance!
> ---
> Rune Elvemo

> http://www.sn.no/~elvemo

+---------------------------------------------+

|                                             |
|Home page:                                   |
| http://www.ping.be/user/Christ.Vandromme    |
+---------------------------------------------+


Sun, 18 Apr 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Dereferencing f-pointers, arrays of f-pointers, pointers to f-pointers

2. Pointer of Pointers was Pointer of arrays...

3. Pointers: return of pointer to array of pointers to main

4. Array of pointers, pointer to array...

5. array pointer/pointer array

6. arrays pointers array of pointers

7. making pointers to structure elements using array elements

8. Pointers to Arrays made w/ new operator

9. Pointer to array of pointers

10. pointers to pointers to arrays

11. Pointer to an array of pointers to functions

12. limit on pointer to array of pointers?

 

 
Powered by phpBB® Forum Software