guix:
HelloUsing sprintf is the easiest solution I think.
int var;
chat str[] = "M1:1023;";
sprintf( str, "M1:%d;", &var );
// var is now = 1023
Not with sprintf you won't. That will put "M1:308" into the variable str (where 308 is the address of the variable "var").
I think you meant sscanf().