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

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


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.


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.


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.


What is the difference between classes and structure?

Classes are expanded concepts of structures, and can hold functions along with variables and other information.

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


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

homologus structures


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.


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.


What are the structures and functions of nucleolus?

it's structures and functions are the movements and the flowtations to create destinations of messages of transporting goods to your body to function properly


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 is the study of structures and functions of the organisms?

physiology


What are some of the common functions of structures?

Geology


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