# Functions

An IDC function always returns a value. There are 2 kinds of functions:

* [built-in](https://idc.docs.hex-rays.com) functions
* user-defined functions A user-defined function is declared this way: static func(arg1,arg2,arg3) { [statements](/developer/idc/core-concepts/statements.md) ... } It is not necessary to specify the parameter types because all necessary type conversions are performed automatically.

By default all function arguments are passed by value, except:

```
  - objects are always passed by reference
  - functions are always passed by reference
  - it is possible to pass a variable by reference using the & operator
```

If the function to call does not exist, IDA tries to resolve the name using the debugged program labels. If it succeeds, an [dbg\_appcall](https://idc.docs.hex-rays.com/dbg_appcall.html) is performed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/developer/idc/core-concepts/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
