我想知道如何将字符串添加到 char* 数组中
#define FROM "<rasulasath@Tester.com>"
#define TO "<rasulasath@gmail.com>"
#define CC "<rasulasath@gmail.com>"
#define SUBJECT "TESTING SUBJECT"
string testing("USING variables");
const char * c = "Subject: ";
static const char *payload_text[]={
"To: " TO "\n","From: " FROM "\n","Cc: " CC "\n",c "\n",
"\n", /* empty line to divide headers from body, see RFC5322 */
SUBJECT "\n",
"\n",
"Testing the msg.\n",
"Check RFC5322.\n",
NULL
};
我想将c
变量 testing 添加到 payload_test[] 数组中,或者是否有其他方法可以使用用户创建的变量创建数组 paylod_text[]。