Okay... so you're saying you have 100 different variables, and you want a fairly automated way to process every one of them?
This cannot be done... unless your compiler has some very very obscure macroing commands, and even then, it won't be done very well.
Basically, this is the rule that should illuminate it...
Code:
char * variableName = "IAmVariable";
int IAmVariable;
There is no way to access IAmVariable using the string, variableName. It is impossible, even though the string is the name of the variable. Variable names are only meaningful at compile time, and character arrays are only meaninful at run time. There isn't any interaction between the two (well, this statement might be a bit broad, but it's largely correct).
You really need to use an array of variables... instead of using...
Code:
//100 ints...
int plaintext1;
int plaintext2;
int plaintext3;
// and so on...
int plaintext99;
int plaintext100;
You should use...
Code:
//An array of 100 ints...
int plaintext[100];
Also....
Code:
// In the former method, you would access an int as...
x = plaintext1;
// Using an array, it's very similar....
x = plaintext[0];
It also makes it very easy to deal with each variable.. the code would look like this...
Code:
while(j<=2)
{
// This is a little bit of printf vodoo to get the same output
printf("plaintext%d values are\n", j + 1);
split_Data(plaintext[j],ciphertext1);
j++; // You left this out, and I'm not sure why...
}
Mmmm, 3 lines.
In my examples, I assumed that the variables are of type int. I realise that more than likely, you are handling something different, but I really just don't know.
This is a fairly backwards explanation of arrays which i've put up here, so it is perhaps not so good for understanding. If you need it, I may provide a more complete explanation, although any explanation the people here might muster probably isn't on par with what you would find in a C Programming text. If you have one, check the section in your text on arrays.