answersLogoWhite

0

How do you return array of pointers?

User Avatar

Wiki User

2010-06-22 11:50:34

Best Answer

Example:

int **myfun (void)

{

int **myptr= calloc (sizeof (int *), 100);

return myptr;

}

User Avatar

Wiki User

2010-06-22 11:50:34
This answer is:
User Avatar
Study guides

What is a programming language

What does DOS stand for

What is a software that is distributed for free

What do unix and Linux have in common

➡️
See all cards
3.95
61 Reviews

Add your answer:

Earn +20 pts
Q: How do you return array of pointers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an array of pointers to pointers?

line


Is it possibly to return an array of strings in a function without using pointers in C plus plus?

No.


Is indirection operator use in an array?

Array elements can be pointers, and pointers can point to array elements, if that's what you mean.


What is the difference between array of pointers and pointer to an array?

An array of pointers is that for eg if we have array of 10 int pointers ie int *a[10] then each element that which is stored in array are pointed by pointers. here we will have ten pointers. In pointer to an array for eg int(*a)[10] here all the elements that is all the ten elements are pointed by a single pointer.


What is an array pointers?

I guess it is an 'array of pointers'. Example:int main (int argc, char *argv[])


What is the difference between array to pointer and pointer to an array?

There is no such thing as an "array to pointer." What you might be asking is "array of pointers." An array of pointers is just that, an array in which the variables are pointers. In C this would be an array of pointer variables that are each 4 bytes in size. It is declared like this: int *pointers[3]; A pointer to an array is a pointer that points to the whole array. For example, in C if you have int numbers[5][10]; int (*pointerToArray)[10] = numbers + 2; pointerToArray points to the third element of numbers, which is itself an array.


How do you declare An array of three pointers to char?

char* my_array[3]; /* an array of three pointers to char */


How do you declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

Typedef the function signature then create an array of pointers of that type. char* func1() {/*...*/} char* func2() {/*...*/} char* func3() {/*...*/} typedef char* (*func_ptr)(); func_ptr func_array[3]; int main() { func_array[0] = &func1; func_array[1] = &func2; func_array[2] = &func3; /*...*/ return 0; }


Difference between arrays and pointers in c language?

There is a difference: a pointer is a number that literally points to a place in memory. Arrays are groupings of a type. There is a close relationship between pointers and arrays, however: every expression with arrays (example: array[i]) can be expressed with pointers (example: *(array + i)), because for the computer, an array is just a list of pointers to the type of the array.


What is Arrays of Pointers?

An array of pointers is a contiguous block of memory that contains pointers to other memory locations. They essentially allow non-contiguous memory locations to be treated as if they were an actual array.


How do you implement 3 stacks in one array?

Use the array to maintain pointers to each stack.


Why array is a implicit pointer?

Arrays are implemented as pointers in c.

People also asked