#include <iostream>
#include <string>
#include <cstring>
int main() {
std::string str = "C++ Programming";
size_t size = str.size();
// Dynamically allocate memory for the byte array
unsigned char* byteArray = new unsigned char[size];
std::memcpy(byteArray, str.c_str(), size);
for (size_t i = 0; i < size; i++) {
std::cout << static_cast<int>(byteArray[i]) << " ";
}
// Free the allocated memory
delete[] byteArray;
}
/*
run:
67 43 43 32 80 114 111 103 114 97 109 109 105 110 103
*/