answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When an array name is passed to function in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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 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.


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).


How are the strings passed to a function?

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)


How delete an array of object within the object in C?

First locate the position of an array by search after than use a delete function to delete an array


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]);


The most common function of an array is to store variables however there will be times when an array is used to store objects. briefly describe four such objects?

Any name can be placed in an array, be it a primitive name or an object name, even a function pointer. Four examples of common objects that may be placed in an array include any object defined in the STL (standard template library), which includes vectors, lists, iterators and maps. All are self-explanatory, although a vector is simply an array implemented as an object. Therefore an array of vectors is nothing more than an array of arrays (effectively a multi-dimensional array). However, vectors are the "correct" way of implementing arrays in C++ (unless you specifically wish to use C-style code in your C++ projects), thus a multi-dimensional array is best implemented as a vector of vectors.


Can you pass addresses to a function in C plus plus?

If the identifier you want to pass is an ordinary identifier, pass it as the address of... function(&identifier); If the identifier you want to pass is an array identifier, pass its name... function(arrayname);


Why should a function that accepts an array as an argument and processes that array also accept an argument specifying the array?

Basically in c++ passing an array as an argument only provides a pointer to the first value and that function won't know how many values it has.If you read beyond the size you will just get garbage from memory.


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.


Sorting an array in PHP without using sort function?

plz as soon as possible give me the program for shorting an array in asscending order without using any sort function in c++


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

No.