K
Konx
Hi everyone.
I've already searched something related on internet and I've tried
various solutions, but they don't work.
Problem: I have a int variable and 2 char variable, and I want to
merge them into a single char variable. What I'm doing now is this:
int a = 3;
char* b;
b = (char*) a;
errorLabel
char *comm= "PULS:TRAN1 ";
char *end= "NS\n";
char *command;
command = new char[strlen(comm)+strlen(b)+strlen(fine)+1];
strcpy(command,comm);
strcat(command,b);
strcat(command,fine);
This is coming from a solution I've found on the web. This code is
compiling but then, when I run the program, it crashes.
What could be the problem?
Thanks for any help,
Konx.
I've already searched something related on internet and I've tried
various solutions, but they don't work.
Problem: I have a int variable and 2 char variable, and I want to
merge them into a single char variable. What I'm doing now is this:
int a = 3;
char* b;
b = (char*) a;
errorLabel
char *comm= "PULS:TRAN1 ";
char *end= "NS\n";
char *command;
command = new char[strlen(comm)+strlen(b)+strlen(fine)+1];
strcpy(command,comm);
strcat(command,b);
strcat(command,fine);
This is coming from a solution I've found on the web. This code is
compiling but then, when I run the program, it crashes.
What could be the problem?
Thanks for any help,
Konx.