fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. const char* baseKey = "0123456789abcdef";
  8. unsigned char* encKey = new unsigned char[16];
  9. memset(encKey, 'f', 16);
  10. int offset = 2;
  11. int writeCount = 16 - offset;
  12. strncpy((char*)encKey + offset, baseKey, writeCount);
  13. encKey[0] = 'a';
  14. printf("%s", encKey);
  15. return 0;
  16. }
Success #stdin #stdout 0s 4312KB
stdin
Standard input is empty
stdout
af0123456789abcd