Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
char ポインターをカットしてパケット ヘッダーを削除することは可能ですか?
ループを回避するには:
Decryptor dec; char * datae = new char[_packet[0] - 8]; char * decrypted; for(int i = 0;i<_packet[0] - 8;i++) { datae[i] = _packet[8+i]; } decrypted = dec.decrypt(datae, _packet[0]-8);
Decryptor dec; char * decrypted = dec.decrypt(_packet + 8, _packet); // _packet[0] - 8 is going to give you the value of the character at _packet[0] minus 8, which is not likely to be what you want.