answersLogoWhite

0


Best Answer

number = myfirstfunction (text, freq); // The first function, where "text" is a string, // and "freq" is the array that is filled with data mysecondfunction (number, freq); // The 2:nd function where the value from the previous // function is being used, and the array "freq" is // bring printed.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you reference a array from one function to another?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

How do you pass a one-dimensional array to user-defined functions?

In C++ you would pass a std::array if the array is fixed-length, otherwise you'd use a std::vector. Most object oriented languages will provide some method of passing a self-contained array object to a function. In C and other non-object oriented languages you would pass a reference or pointer to the start address of the array along with a variable indicating the number of valid elements within the array. The array type will determine the size of each element.


How are entire arrays passed from one method to another?

In some programming languages, like C, you can pass the new method (or function) an address pointer to the first element in the array. As long as you don't leave the scope of the method the array was created in, the array will remain valid. In other languages that don't support memory addresses, like FORTRAN, it must be done by making the array global.


Write a function in java that accepts an array of integers and returns the second largest integer in the array Return -1 if there is no second largest?

Method 1: Sort the array in descending order, compare 1st and 2nd if not same , return 2nd if same return -1 Method 2: Find the largest number in the array, initialize another array with dimension 1 less than of original. Copy the array elements from the original array minus the largest element. not select largest from the second array and compare with the previous one if not same return the second largest if same return -1


What is the definition of parent function?

When a function is nested inside another function, the outer one is the parent, the inner is the child.


How do you identify a function?

A function is a mapping from one set to another such that each element from the first set is mapped onto exactly one element from the second set.

Related questions

How do you merge two array without using function?

Take another array big enough to hold both array copy content of these two array into new one. You merged two array and haven't used a single function.!


How do you pass an array as a parameter?

AnswerUnfortunately your question is to broad. All progamming languages vary in the way things are done. I will just give a general way of doing it.You have to pass the multidimensional array into the function by including it with calling the function. On the receiving end you have to declare another multidimensional array so the information can be passed into it. Depending on the language, you may not be passing in a multidimensional array, instead that array may be stored in an object which you can pass instead.Hope this helps some.-Ashat-in C, when passing two dimensional arrays the compiler needs to know the width so it can calculate memory offsets.passing a 2d array of width 4:voidFunc(type array[][4]);


When utilizing a function what does a range of cells represent?

A range can be one of the arguments in a function. It can also be an array of values. It depends on the function and what it needs to work.


How do you pass a one-dimensional array to user-defined functions?

In C++ you would pass a std::array if the array is fixed-length, otherwise you'd use a std::vector. Most object oriented languages will provide some method of passing a self-contained array object to a function. In C and other non-object oriented languages you would pass a reference or pointer to the start address of the array along with a variable indicating the number of valid elements within the array. The array type will determine the size of each element.


What is one word for 'array of food'?

Buffet. Another answer is smorgasbord.


What are examples using vlookup and hlookup?

First of all vlookup/hlookup function helps us to connect between data array - we can retrieve data from one array to another when we have on common data (for example ID number) in both arrays. There are many uses for vlookup/hlookup function for example: 1. Calculate salary - in one able you have worker ID and the salary per hour and in the other worker ID and number of hour worked. 2. convert sales in unit to value (one table contains sales in units, the other cost per unit - both have unit reference number)


How are entire arrays passed from one method to another?

In some programming languages, like C, you can pass the new method (or function) an address pointer to the first element in the array. As long as you don't leave the scope of the method the array was created in, the array will remain valid. In other languages that don't support memory addresses, like FORTRAN, it must be done by making the array global.


What does array combine function do in php?

Creates an array using one value for keys and other for its values http://php.net/manual/en/function.array-combine.php


How do you represent a one dimensional array in memory?

A one-dimensional array is always represented as a single contiguous block of memory. The size of the allocation is determined by the array's type and the number of elements of that type. For instance, if you create an array of 10 elements where each element is 4 bytes in length, the total allocation will be 40 bytes. The array name is a reference to the start of the allocation and individual elements are accessed via an indexed offset from this reference, such that the first element is at offset 0, the next is at offset 1, and so on.


How do you append post variable in an array in php?

The $_POST variable is an array already, so if you want to append it to another array, you can use the array_merge function to do so. For example:$foo = array('alpha', 'bravo', 'charlie');$bar = array_merge($foo, $_POST);If there were two variables posted, one called "blah" with a value of 7 and one called "snarf" with a value of "snoo", then the $bar array would now be:Array(0 => 'alpha',1 => 'bravo',2 => 'charlie','blah' => 7,'snarf' => 'snoo')


What is a circular reference?

If you have one reference that leads to another and then another which finally comes back to the first, making a circle or closed loop, this is a circular reference.


Does mentioning the array name gives the base address in all the contexts?

Mentioning the array name in C or C++ gives the base address in all contexts except one. Syntactically, the compiler treats the array name as a pointer to the first element. You can reference elements using array syntax, a[n], or using pointer syntax, *(a+n), and you can even mix the usages within an expression. When you pass an array name as a function argument, you are passing the "value of the pointer", which means that you are implicitly passing the array by reference, even though all parameters in functions are "call by value". There is, however, one very important distinction. While an array name is referentially the same as a pointer, it is not a pointer in that it does not occupy program referential space in the process. This means that, while you can change the value of a pointer, and thus the address to which it points, you can not change the value of an array name. This distinction is what we call R-Value (array or pointer) as opposed to L-Value (pointer only), i.e. can the object appear on the left sign of an assignment operator.