Is it possible to use a for loop to change a variable name in C?
问题 This is a generic question, so there is no actual code that I am trying to troubleshoot. But what I want to know is, can I use a for loop to change the name of a variable in C? For instance, if I have part1 , part2 , part3 , part... , as my variable names; is there a way to attach it to my loop counter so that it will increment with each passing? I toyed around with some things, nothing seemed to work. 回答1: In C, you can't 'change the name of the loop variable' but your loop variable does not