answersLogoWhite

0

Simply by sending the base address from main() and catching that in a pointer in the pointer.

void main()

{ int a[20];

sort(a);

}

void fun(int *p)

{

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.


Are arrays in C created on the stack or the heap?

That depends on where you define them. Arrays defined inside functions are declared on the stack (like other variables defined in functions). Arrays defined outside of any function, or using the static keyword inside a function are allocated in the static data area of the program. Other arrays may be allocated using malloc() (or "new" in C++); these are allocated on the heap.


What are commonly use libraries of c plus plus function arrays?

Function arrays are nothing more than arrays of function pointers so, besides the stddef header, you don't really need any libraries to implement a function array unless those functions use a type that isn't available in stddef. #include<stddef.h> void func_1() {} // obviously you must provide void func_2() {} // implementations for these void func_3() {} // functions // a function array void (*function_array[])() = { func_1, func_2, func_3 }; int main() { for(unsigned i=0; i<3; ++i) function_array[i]; // call the function }


Why do you use ampersand symbol for arrays and not for a string?

You don't need to use ampersand for arrays; it's entirely optional even for strings (character arrays). This is because arrays will implicitly convert to a pointer at the slightest provocation. Thus for an array named X, you can either pass the array to a function as X, &X or &X[0], they all refer to the exact same address.


How do you find the difference between two arrays in Java?

for arrays you can list the different arrays and what attributes that you give to them.

Related Questions

What is a PHP function that can sort arrays by other arrays?

You cannot sort arrays by other arrays; that wouldn't make sense, anyway.


What is the main features of function?

Arrays


How can arrays be used for inter function communication?

The size of a function can be determined from the size of the array. Arrays and functions are both used in computer programming.


What is the way by which you can make the user defined the size of the arrays?

By using the library function #define A[] we can define the size of arrays


Are arrays in C created on the stack or the heap?

That depends on where you define them. Arrays defined inside functions are declared on the stack (like other variables defined in functions). Arrays defined outside of any function, or using the static keyword inside a function are allocated in the static data area of the program. Other arrays may be allocated using malloc() (or "new" in C++); these are allocated on the heap.


What is the process for generating a numpy cartesian product in Python?

To generate a numpy cartesian product in Python, you can use the numpy.meshgrid() function. This function takes in multiple arrays and returns a meshgrid of all possible combinations of the input arrays.


How do you get difference between two or more arrays in PHP?

The inherit function `array_dif($arrayOne, $arrayTwo, $arrayThree, ...)` is likely what you're looking for. It compares two or more arrays, and returns an array of values that are unique among the arrays.


What are commonly use libraries of c plus plus function arrays?

Function arrays are nothing more than arrays of function pointers so, besides the stddef header, you don't really need any libraries to implement a function array unless those functions use a type that isn't available in stddef. #include<stddef.h> void func_1() {} // obviously you must provide void func_2() {} // implementations for these void func_3() {} // functions // a function array void (*function_array[])() = { func_1, func_2, func_3 }; int main() { for(unsigned i=0; i<3; ++i) function_array[i]; // call the function }


Why do you use ampersand symbol for arrays and not for a string?

You don't need to use ampersand for arrays; it's entirely optional even for strings (character arrays). This is because arrays will implicitly convert to a pointer at the slightest provocation. Thus for an array named X, you can either pass the array to a function as X, &X or &X[0], they all refer to the exact same address.


How do you pass a 2D array in a functions?

if you were to call a function you would write it as: function(array[][], int pretend, double pretend2); arrays will always be passed by reference, not by value.


What is multidimentional array?

Arrays having more than one dimension is known as multi-dimensional arrays. Multi-dimensional arrays is also known as arrays-of-arrays.


What is a multidimentional array?

Arrays having more than one dimension is known as multi-dimensional arrays. Multi-dimensional arrays is also known as arrays-of-arrays.