function - What does the ## operator mean/do in this C macro? -


#define swap(t, x, y) \   { \    t safe ## x ## y; \    safe ## x ## y = x; \    x = y; \    y = safe ## x ## y; \   } while (0) 

the code swaps arguments x , y of type t.

the ## (double number sign) operator concatenates 2 tokens in macro invocation (text and/or arguments) given in macro definition. read more


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -