# 0123: A 'thiscall' function requires a pointer

Compiler found a [foreign function](/language/functions.md#foreign-functions) declaration with `thiscall` calling convention, but didn't find a required argument for the function.

`thiscall` functions are methods of a class, and by definition work with many instances of that class. They must have at least one argument that will identify the instance on which this method is called. Imagine a method `Destroy` of class `Car`:

```swift
function Car_Destroy<thiscall,0x0C0DE000>()
```

Without an instance argument it is unclear what particular car needs to be destroyed.

#### Possible solutions:

* define a parameter of type `int` in the function declaration:

```swift
function Car_Destroy<thiscall,0x0C0DE000>(struct: int)
```

When calling this method, you must also provide a valid argument:

```swift
int car_address = GET_VEHICLE_POINTER myCar
Car_Destroy(car_address)
```


---

# 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.sannybuilder.com/troubleshooting/errors/0123.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.
