You cannot add char arrays like that. Two ways to do it, you can do it manually, or using sprintf, which is just like printf but stores it in another char array.
So in your case:
#include "mbed.h"
int main() {
char buffer[20];
char *response = "test";
sprintf(buffer, "this is a %s ", response);
printf("Response=%s\r\n", buffer);
}
In your code you added it to the original char response, so I did that also at first, wondering why it didnt work. But the original response array has a certain length, if you add the other text to it you get a buffer overflow, corrupting the program. You can do that, but then you have to define response as a larger buffer.
I'm a new at the c++ language, so here's a real newbee question...
I'm trying to combine a char pointer with a line of text and store it again in the char pointer. But i can't figure out how to do it.
This compiles the error: expression must have integral or enum type.
I can't change the variable type to string or something like that, it has to be a char * variable (to use with other functions) How do i solve this?
Thanks in advance!