I need to select and print one from a group of several texts, and var_name is constructed in a separate subroutine, so it is the name of the choosen text variable (var_name in this case).
Trying to explain widely, this is the code with more details:
Code:
#include <stdio.h>
char var_name[9];
char* fsubroutine (pto_cel pcpto);
int main()
{
char *chNepC01 = "01blablablsblablablablsblablablablsblablblblaaabla0101010101.\n";
char *chNepC02 = "02blablablsblablablablsblablablablsblablblblaaabla0202020202.\n";
char *chNepC03 = "03blablablsblablablablsblablablablsblablblblaaabla0303030303.\n";
...
char *chNepC0N = "0Nblablablsblablablablsblablablablsblablblblaaabla0N0N0N0N0N.\n";
/* fsubroutine(sol) = var_name could be "chNepC01", "chNepC02", "chNepC03"... "chNepC0N" */
fsubroutine(sol); /* this is a string */
printf("%s\n", fsubroutine(sol)); /* I want to print the text, but prints the NAME of var_name */
or...
fsubroutine(sol); /* this is a string */
printf("%s\n", var_name); /* I want to print the text, but prints the NAME of var_name */
return 0;
}
char* fsubroutine(pto_cel pcpto) /* constucts the string "var_name" depending of some parameters */
{
...
...
return var_name;
}