i have defined a value using
#define username "admin"
then i want to use the username in a char statement into sql as
const char *pSQL[1];
pSQL[1] = "update websrv_config set admin_id='" + username + "'";
but it seems that there is an error
error: invalid operands of types ‘const char [36]’ and ‘const char [6]’ to binary ‘operator+’
how can i overcome it?
Try this:
In c++ array index starts with 0 so when you have decleared an array of length 1. The only index it can have is 0. Further, ‘+’ is not used for concatenation in c++.