Cant Concate 2 variable

#include <Sim800l.h>
#include <SoftwareSerial.h>
Sim800l Sim800l; //declare the library
char* text;
char* number;
bool error;


void setup(){
Sim800l.begin();
text="Testing Sms";
text=text+" hooman";
number="########";
error=Sim800l.sendSms(number,text);

void loop(){
//do nothing
}
This Error Appeared
invalid operands of types 'char*' and 'const char [8]' to binary 'operator+'
Please Help me
You need to manage the memory yourself, this is C and not C++.

1
2
3
char text[100]; // make sure this is large enough
strcpy(text,"Testing Sms");
strcat(text," hooman");

if this is supposed to be c++, you CAN use the + operator with strings, but not char*. you can still use the sim800 send by string.c_str() if it requires a char*.

which language are you trying to use?
Topic archived. No new replies allowed.