我怎样才能自动化变量输入数组列表

how can I autoamate variable input array lists

我需要调用一系列需要输入数组中的列表的函数,如下所示:

1st call to func:
custom_type_t inarray = {1,2,3,4,5,6,7,8,9,10};
2nd call to func:
custom_type_t inarray = {11,12,13,14,15,16,17,18,19,20};
...

我如何将它打包到一个函数中,我可以用一个特定的参数调用它,它会提取数字并相应地填充数组? 我应该相应地使用预编译器吗?感谢您的任何想法!

for(int i = 1; i < 11; i++) inarray[i - 1] = i;

for(int i = 11; i < 21; i++) inarray[i - 11] = i;