answersLogoWhite

0


Best Answer

Structures can be passed to the functions by value. But it has to be copied to another location. Hence wastage of memory

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can structures be passed to the functions by value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

CAN Overloaded functions can return default values?

I'm not sure I understand you as it wouldn't make sense for a function to return a default value. Do you actually mean can a function return an argument that has a default value? If so, then yes. Any argument passed to a function, whether defaulted or not, can be returned by the same function. If the argument is passed by value then you must return it by value. If passed by reference (which cannot be defaulted) then you can either return by reference or by value. However, if you pass by non-constant reference then you can just use the reference as an output argument, and use the actual return value for some other purpose, such as reporting any error condition(s) created by the function. Overloaded functions are no different to ordinary functions, the only criteria is that each overload has an unique signature. The return value does not form any part of the signature, thus signatures cannot differ by return type alone.


How are Structure passing and returning implemented by the complier?

When structures are passed as arguments to functions, the entire structure is typically pushed on the stack, using as many words as are required. (Programmers often choose to use pointers to structures instead, precisely to avoid this overhead.) Some compilers merely pass a pointer to the structure, though they may have to make a local copy to preserve pass-by-value semantics. Structures are often returned from functions in a location pointed to by an extra, compiler-supplied ``hidden'' argument to the function. Some older compilers used a special, static location for structure returns, although this made structure-valued functions non-reentrant, which ANSI C disallows


How does java pass primitive types and objects?

Java uses only pass by value. Primitive data types are passed purely as pass by value whereas for objects a value which is the reference to the object is passed. Hence the whole object is not passed but its reference gets passed. All modifications to the object in the method would modify the object in the Heap.


Cell structures that carry the genetic material that is copied and passed from generation to generation of cells?

Cell structures that carry the genetic material that is copied and passed from generation to generation of cells are called chromosomes. Spindles are cell structures composed of microtubule fibers.


In what way is an argument passed by so it is not affected by a change of the content of the parameter value?

Pass by value.

Related questions

Similarities between union structure enum in c?

Structures and unions share the following characteristics: * Their members can be objects of any type, including other structures and unions or arrays. A member can also consist of a bit field. * The only operators valid for use with entire structures and unions are the simple assignment (=) and sizeof operators. In particular, structures and unions cannot appear as operands of the equality ( == ), inequality (!=), or cast operators. The two structures or unions in the assignment must have the same members and member types. * A structure or a union can be passed by value to functions and returned by value by functions. The argument must have the same type as the function parameter. A structure or union is passed by value just like a scalar variable; that is, the entire structure or union is copied into the corresponding parameter. similarity is all three are user defined data types.


What are the functions for the cell structures?

structures that perform the organic functions at the level of the whole body are called


Do functions get called by reference only?

No. Function parameters are passed by value. Always. Even the so called "call by reference" is a value - the value of the pointer or the address of the object - but what is placed in the parameter list is a value.


Structures that are similarly built but have different functions are called?

homologus structures


What mean by reference function in c?

Reference function has no meaning. Variables are passed to functions by reference or by value, depending on the function signature.


What are the basic program structures in visual basic?

Classes Structures Subroutines Functions


What are the functions of the valva?

The vulva structures cover the deeper structures of the female perineum.


Why do you need functions which return nothing?

Sosme functions don't return anything, they are declared as void. But they still do useful work - they can work on the parameters that are passed to them and modify them instead of sending back a return value.


What is the study of structures and functions of the organisms?

physiology


What are structures and functions?

product orientated disadvantages


What are structures that have different functions in different species but develop from the same embryonic tissue?

Homologous structures are anatomical structures that share a common evolutionary origin, but may have different functions in different species. These structures develop from the same embryonic tissue and demonstrate evolutionary relationships between species. An example is the forelimbs of vertebrates, which have different functions such as wings in birds, flippers in whales, and arms in humans.


How do the structures within the cell allow it to specialize?

The structures allow the cell to perform specific functions.