Dynamic construction variable using macro

xiaoxiao2021-03-06  14

Dynamic construction variable using macro

Using macro predetermined in C / C is a very good choice, especially with ##, and the function is more powerful. See example first:

#include "stdio.h" #define convar (Head, INDEX) Head ## ion index

INT main () {int A1 = 3; convaR (A, 1) = 4; Printf ("% D", A1); scanf ("% D", A1); RETURN 0;}

With DEFINE and ##, two symbols can be connected to dynamically form variables.

转载请注明原文地址:https://www.9cbs.com/read-67803.html

New Post(0)