> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# chat_user::local function

> chat_user::local function

# chat\_user::local function

Returns a pointer to the [chat\_user\_local](/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) object associated with this user, if the user is local.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
chat_user_local* local(  
)  
```

<a id="parametersSection" />

### Parameters

None.

<a id="retvalSection" />

### Return value

Type: [chat\_user\_local](/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local)\*

Returns a pointer to the [chat\_user\_local](/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) object associated to this user, if the user is local; otherwise, `NULL`.

<a id="remarksSection" />

## Remarks

This method returns a pointer to the [chat\_user\_local](/reference/chat/gamechat2/classes/chat_user/chat_user_local/chat_user_local) object associated with this [chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user) object, if the user is local. The returned pointer remains valid for the life of the associated `chat_user` object, which is until the user has been removed by a call to the [chat\_manager::remove\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user) method. For more information about adding local and remote users to the local [chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager) instance for your app, see the [Adding users to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2#adding_users_to_game_chat_2) section in [Using the Game Chat 2 C++ API](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2).

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_user::local](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function-overloads)\
[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [chat_user::local function - overloads](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function-overloads.md)
- [chat_user::local](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function_2.md)
- [chat_user_local::remote_user_muted](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_remote_user_muted.md)
- [chat_user_local::microphone_muted](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_microphone_muted.md)
- [chat_user_local::send_chat_text](/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_send_chat_text.md)
