Is there a way to combine keywords in a macro and get C to behave more dynamically, as in:
#define macro(fun,ction,var,iable) function(variable)
I know that such things exist in other languages.
You can use ## to concatenate names in macros
fun ## ction ...
No. Although there is ##, as Michael says, it is applied (like all preprocessing) before C or C ++ look up keywords, and even using it to generate any preprocessor keyword allows the preprocessor to fail.
##
, , - , , .
There are some caveats for using it (for example, you need to go through some hoops to combine the results of other macro extensions), but the GCC docs discuss the basic form:
http://gcc.gnu.org/onlinedocs/cpp/Concatenation.html
http://en.wikipedia.org/wiki/C_preprocessor#Token_concatenation
Source: https://habr.com/ru/post/1743077/More articles:Как проверить динамически созданный файл на Java? - javalibrary classes or model classes? - oopunderstanding mvc: the difference between a library class and a model class - phpHow to create a specific CPPDEFINE such as -DOEM = "FOO BAR" using Scons - sconsСоздание пользовательского веб-сайта портала публикации в SharePoint 2010 - sharepoint-2010Saving RTF Java JTextPane - javaUndefined управляющая последовательность в первой строке документа - latexManual iteration over XML element selection (C #, XDocument) - iteratorSpring Аутентификация безопасности БД с Hibernate и хеширование паролей? - authenticationRails dynamic attachment size - validationAll Articles