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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -