There are several ways to get this done in CVI. One way is to use the Fmt function like in the following way:
#include #include #include
int main (int argc, char *argv[]) { char constant_string[]="ABC_"; char variable_string[250]; char target_string[255];
int i=0;
if (InitCVIRTE (0, argv, 0) == 0) return -1; /* out of memory */
for (i=0; i<10; i++) { // write to variable_string Fmt (variable_string, "%s<%d", i); // append variable_string to constant_string and store result in target_string Fmt (target_string, "%s<%s%s", constant_string, variable_string); printf ("%s\n", target_string); } return 0; }
Regards, Heinrich Illig National Instruments Germany GmbH