---
title: "Discussion on \"Careful about function-like macro parameter naming\" | Hashnode"
description: "Discussion on \"Careful about function-like macro parameter naming\". I needed to create a function-like macro which set a parameter in a default settings struct, simple enough.\nstruct Settings\n{\n   unsigned enabled;\n};\n\nstruct Settings defaultSettings;\n\n#define SetEnabled(enabled) (defaultSettings.enabled = enabled)\n\n..."
url: "https://hashnode.com/posts/careful-about-function-like-macro-parameter-naming/65c3d59da7fd587166d7478e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Careful about function-like macro parameter naming](https://owningmymistakes.hashnode.dev/careful-about-function-like-macro-parameter-naming?utm_source=hashnode&utm_medium=feed)

I needed to create a function-like macro which set a parameter in a default settings struct, simple enough. struct Settings { unsigned enabled; }; struct Settings defaultSettings; #define SetEnabled(enabled) (defaultSettings.enabled = enabled) ...

Feb 7, 2024 · 1 min read · owningmymistakes.hashnode.dev  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)
-   [#macros](https://hashnode.com/tag/macros)
-   [#define](https://hashnode.com/tag/define)

## Written by

[Kim Lillås](https://hashnode.com/@klillas)

@klillas

  
[View profile](https://hashnode.com/@klillas)

Professional software developer with an interest in anything and everything technical

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
