Varying variable names?

Is there any way to make the names of my variables vary according to a separate counter?

I want to assign var = 1, and var++ within my program and then assign different strings to str1, str2, str3 etc. Is there any way to

string str(var) = "Blah blah blah"

?

Yes, it's called array and looks like so:

1
2
3
string str[5]; // definition of the array
int var = 0; // values must not exceed 0...4!
str[var] = "Blah blah blah"; // accessing the array 
Topic archived. No new replies allowed.