I am writing a program that will analyze a simple map that will be defined by a sequential data file. Each data file may have a different number of vertices and legs.
For example, the 'map' that looks like a plus-sign would have 5 vertices and 4 legs. I need to define variables, something along the lines of vert1, vert2, ... , vert5, leg1, ... , leg4.
I tried using the token-pasting operator in a loop to declare the variables, but I must be doing something wrong. First, it seems to want me to declare vert and leg as variables before it will paste. That I can understand, and it wouldn't cause any problems. However, when I do that, I end up with variables like 'legloop' of 'vertn' (where loop or n are the loop controlling variables) instead of leg1 or vert6.
Is the token paster the way to go here?
If so, how should it be used?
If not, what method should I use?