0

Can anyone help me with this conversion from MikroBasic to MikroC?

in MB:
FormattedDataString = text + "," + text1 + "," + text2 my effort in C : FormattedDataString = (text + "," + text1 + "," + text2); char FormattedDataString [100]; char text,text1,text2;

Regards Sarel

1 Answers1

1

What you need is the function strcat. The prototype definition is:

char *strcat(char *to, char *from);

The first line will be to copy text to FormattedDataString using strcpy. The prototype definition is:

char *strcpy(char *to, char *from);

So it's like:

strcpy(FormattedDataString, text);
strcat(FormattedDataString, ",");
strcat(FormattedDataString, text1);
strcat(FormattedDataString, ",");
strcat(FormattedDataString, text2);

Please refer to the help section of MikroC.

Nathu
  • 262
  • 1
  • 5
  • 23