Elektrine lite

← Feed

@typeswitch@gamedev.lgbt

Post #1981519

2026-05-04 12:23 UTC

@Steel_Virgin It's a way to create new identifiers from arguments. In a macro, x##y is a way to concatenate the x and y tokens. So if for example x is a macro argument and y isn't, let's say we passed in foo for x, then x##y would become fooy. If y is a macro argument as well, e.g. bar, it also gets replaced, e.g. x##y becomes the single token foobar. This is useful for macro programming but it's also terrible 🙃

Replies (1)

  • @Steel_Virgin@eldritch.cafe 2026-05-04 12:31

    @typeswitch it sounds like forbidden things to do in an hidden .h that you hope no one finds. But it lets you write for ennumerate() like it's built-in. And it make mister boss happy because he has no idea its not a regular C syntax but he understands because it looks like the python 101 course he once had in 2008. anyway thank you for the explanation :3

    Open ##1981520