answersLogoWhite

0

Can functions be defined in C structures?

Updated: 8/16/2019
User Avatar

Wiki User

8y ago

Best Answer

No, all functions must be defined outside of C structures. However, all functions in C have a type (the return type) and an identity (an address), so you can define function pointers as members of a structure to achieve the same end.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can functions be defined in C structures?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the pre-defined function in c plus plus?

The C++ standard library contains all the pre-defined functions.


What is the difference between pre defined functions and user defined functions?

Predefined functions are functions that have been written and we can use them in our C++ statements. But we must know how to use each of these predefined functions.


Is the main function in C a built-in function or user-defined function?

The main function in C is user-defined. Built-in functions are simply those that do not require a library to be included, but every program must provide a user-defined point of entry; it cannot be built-in. Indeed, most functions in C are user-defined; the built-in functions are mostly operators rather than functions although most do behave like functions. The standard library functions are not built-in either; they all require the inclusion of the appropriate standard library header.


What is headderfile in c language?

Header File in C/C++ are the files which contains the definition of the pre-defined functions, data-types & constants, etc. By adding the header file you reduce your job of defining the same functions which are defined earlier by someone else & you can use those functions/data-types easily.


What are some of the benefits of programming in C Sharp?

There are many advantages to C sharp programming like: Not having to define the Headers (.h), Classes can be defined within classes, classes and functions can be defined in random order unlike C and C++, Classes and functions don't need to be declared in the program.


How do you pass structures as a parameter to the functions in c plus plus?

Put their names into the parameter-list.


What is use of user defined data in c?

to create user defined functions the user defined data is needed nd its useful to the programmer to create its own data.


What are the in-built function in c plus plus?

C++ built-in functions are those functions that are provided for you as part of the language itself, and includes all of the C standard library functions (all of which were inherited from C) and is expanded upon by the C++ standard template library. C++ implementors may provide additional functions that are platform-specific, however these are not considered built-in functions becuase C++ is a cross-platform language. These are best described as 3rd party functions. The functions you yourself write are known as user-defined functions.


What has the author Donald C Spencer written?

Donald C. Spencer has written: 'Deformation of structures on manifolds defined by transitive, continuous pseudogroups'


What is header file in computer programming?

A header file is used in some languages to declare functions that will be used but are not yet defined in the current source code. This is primarily used by C and C++, and usually for library functions and user-defined functions that are stored in separate files and folders than the main source code file.


In header files whether functions are declared or defined in c language?

Rephrase your question so it is comprehensible.


What has the author C J Ash written?

C. J Ash has written: 'Computable structures and the hyperarithmetical hierarchy' -- subject(s): Computable functions