[Solved] C: Creating a given number of variables automatically [closed]


The solution is to use array.
example:

//n is number of variables

int *var;

var=  malloc(sizeof(int) * n);

variables are named var[0], var[1]....var[n-1]

2

solved C: Creating a given number of variables automatically [closed]