answersLogoWhite

0

How can and array be passed to a funaction?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

try this: <function-name> ( <array-name> )

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can and array be passed to a funaction?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Simple non-array variables are usually passed to methods by?

Simple non-array variables are usually passed to methods by value.


How an array passed to a function?

Arrays should be passed by reference or by pointer, never by value (passing by value passes a copy of the reference, not the reference itself). The array length should also be passed to the function (by constant value) to prevent buffer overflows. Alternatively, in object-oriented languages, arrays can be wrapped in a class of object. Since the array is a member of the class, it doesn't need to be passed to the member methods, thus the function can become a member method of the class itself or a derivative of the class. Or the object containing the array can be passed to external functions by reference.


What happen when a c program passes an array as a function argument?

When an array name is passed as a function argument, the address of the first element is passed to the function. In a way, this is implicit call by reference. The receiving function can treat that address as a pointer, or as an array name, and it can manipulate the actual calling argument if desired.


How do you determine the size of an array of int passed to a method?

It really depends on the language. In Java, you can use the .length property.


How do you send an array of strings with a signal in Dbus with Glib bindings?

Arrays are passed as arguments to method parameters. To pass a string array from one activity to another the code is [] stringArray = intent.getStringArrayExtra("string-array");.


When an array name is passed to function in c?

It 's address is received by the function . that any changes in the value of array elements in the function will result in actual change.


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 does array map do in php?

The array_map function in PHP loops over each elements of the passed array(s), and runs the given function. It then returns a new array that contains the values returned by each call to the given function.


What is signifience the name of an array?

The name of an array serves as a reference to the start address of the array and thus to the first element of the array. If the array is fixed length and within the scope of its declaration, the compiler can determine its length from the name alone. However, when an array name is passed to a function, it implicitly converts to a pointer and the size information is lost. thus the size must be passed as a separate argument. The only general purpose exceptions supported by the standard library are null-terminated character arrays (C-style strings) and null-terminated arrays of C-style strings (terminated by a double-null).


Argument Array in java script?

There is an arguments object in JavaScript. This object is treated much like an array (but it's not actually an array.)You can however reference the arguments passed to a function via this array. For instance, if we call a function like so:exampleFunc('Tom', 15, 'potato');Then we can access the value of Tom at the local variable arguments[0].


How is an array name interpretedwhen it is passed to a function?

An array is still an array, regardless of how you pass it into functions. It is still an array-type variable at the beginning of a function. However, the function itself may manipulate the array by "imploding" it into a string with a delimiter, using array values with only specific keys, and such.


Why cannot arrays be passed by values to procedure?

Because C does not have procedures. Because in Java only elementary types (int, double, etc) are passed by-value, objects (array included) by-reference.