answersLogoWhite

0

A structure is a type so you just need to pass the structure as you would any other data type: by reference or by value.

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

Pass a structure to functions?

Passing Structure to a function:type specifier function-name (structure-variable);


Basic structure of c n c plus plus?

The basic structure of a C or C++ program is built around types. A structure is a type. A function is a type. A class is a type. All of these types can be built from primitive (built-in) types and can be used to create ever-more complex types.


What are the subject-matters of data structure?

types of data structure types of data structure


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


What is pass in compiler design?

There are two types of compilers one-pass and multi-pass. Pass means that some of inner operations are repeated several times. If we have one-pass compiler and this source code: i++; i++; i++; Inside compiler it would generate: i = i + 1; i = i + 1; i = i + 1; If compiler would be two-pass: i = i + 3; The more passes compiler has, the better optimized code it can generate, but it is slower because it must repeat some steps again.

Related Questions

Pass a structure to functions?

Passing Structure to a function:type specifier function-name (structure-variable);


What structure composed two or more tissue types that work together perform specific functions for the body?

An organ is a structure composed of two or more tissue types that work together to perform specific functions for the body. Examples of organs include the heart, lungs, and liver.


What are the kinds of sentences according to functions and structure?

sentences according to functions and structure


Basic structure of c n c plus plus?

The basic structure of a C or C++ program is built around types. A structure is a type. A function is a type. A class is a type. All of these types can be built from primitive (built-in) types and can be used to create ever-more complex types.


What are organs, and how are they made up of tissues?

Organs are structures in the body that perform specific functions. They are made up of different types of tissues that work together to carry out these functions. Tissues are groups of cells that are similar in structure and function. In an organ, different types of tissues come together to form a specialized structure that performs a specific task.


Does cell structure determine functions?

Yes, cell structure plays a crucial role in determining the functions of a cell. The specific organelles present and their arrangement within a cell influence its ability to carry out specific tasks such as energy production, protein synthesis, or waste removal. Variations in cell structure contribute to the diverse functions of different cell types in the body.


What are the types of trigonometric functions?

There are three types of trigonometric functions, they are: 1- Plane Trigonometric Functions 2- Inverse Trigonometric Functions and 3- Hyperbolic Trigonometric Functions


Why nucleus is not in the same place within different types of cells?

every cell is different, different size different functions different placements in the structure


Types of functions?

there are various types of functions namely composite,polynomials, power,root


What are the subject-matters of data structure?

types of data structure types of data structure


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 can you check whether the contents of two structure variables are same or not?

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.