English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

eg. char arr[100];

I want to point position arr[5] to a linked list of strings.
The pointer the linked list is called head. So I want to point arr[5] to head.

Thanks

2006-10-15 17:59:14 · 3 answers · asked by candice 2 in Computers & Internet Programming & Design

3 answers

If you want to have an array of pointers, then you're going to want to make the array type be whatever the type of reference is that you're using.

So, i would think you'd want to make the array type be the same as the linked list object type that you're using, and then set that array position equal to the reference to the head object.

Now, when i say this, i'm thinking in Java. It may work somewhat differently in C++, and whatnot.

2006-10-15 18:07:50 · answer #1 · answered by extton 5 · 0 0

You can't, linked lists are objects and Array's can only store primitive data types.

You could use an Array List

2006-10-15 18:29:55 · answer #2 · answered by Brady 3 · 0 0

http://www.eecs.harvard.edu/~ellard/Q-97/HTML/root/node11.html

2006-10-15 18:14:58 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers