N
Nicholas
How can I use strcat in the following scenario?
char line[250] has the following content "(360+c)" and not declared as
string literal
The purpose is that I want to prepend '0-' in front of line, for my formula
to work. I tried to do the following, but prev still contains the original
"(360+c)" and final gives me garbage characters
char prev[1] = '0';
strcpy(var, line);
strcat(prev, var);
strcpy(final, prev);
line --> "(360+c)"
prev should be --> "0-(360+c)"
final should be --> "0-(360+c)"
what is wrong with the char prev[1] = '0'; ?
Thank you for the inputs
char line[250] has the following content "(360+c)" and not declared as
string literal
The purpose is that I want to prepend '0-' in front of line, for my formula
to work. I tried to do the following, but prev still contains the original
"(360+c)" and final gives me garbage characters
char prev[1] = '0';
strcpy(var, line);
strcat(prev, var);
strcpy(final, prev);
line --> "(360+c)"
prev should be --> "0-(360+c)"
final should be --> "0-(360+c)"
what is wrong with the char prev[1] = '0'; ?
Thank you for the inputs