For starters variable length arrays like this
int length = strlen(sMsg);
char sMsg_Crypt[3][length];
is not a standard C++ feature.
You could use at least an array of objects of the type std::string
like for example
std::string sMsg_Crypt[3];
Nevertheless the problem is that the array sMsg_Crypt[0]
dies not contain a string. That is you forgot to append inserted characters in the array with the terminating zero character ''
.
You could write after the for loop
sMsg_Crypt[0][length] = '';
provided that the array (if the compiler supports VLA) is declared like
char sMsg_Crypt[3][length+1];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…