fork(1) download
#include <iostream>
#include <string>

int main()
{
    char MyCharArray[] = "Hello, Cruel\0World!";
    std::string MyString (MyCharArray, sizeof(MyCharArray)-1);
    std::cout << MyString << std::endl;
    std::cout << "Hello, Cruel" << std::ends << "World!" << std::endl;
}
Success #stdin #stdout 0s 3060KB
stdin
Standard input is empty
stdout
Hello, CruelWorld!
Hello, CruelWorld!