#include <iostream>
#include "stdio.h"
#include "stdlib.h"
#include <cassert>
using namespace std;
std::string zero_string() {
char *zero = new char[2];
zero[0] = 1;
zero[1] = 0;
auto str = std::string(zero);
str[0] = 0;
delete[] zero;
return str;
}
void make() {
char *st = new char[5];
st[4] = 0;
st[0] = 97;
st[1] = 98;
st[2] = 99;
st[3] = 100;
puts(st);
std:string str = std::string(st);
printf("%ld\n", str.length());
puts(str.c_str());
str[3] = 0;
printf("%ld\n", str.length());
puts(str.c_str());
puts(st);
printf("\n\n");
std::string zero = zero_string();
printf("%ld\n", zero.length());
char *another_zero = new char[2];
another_zero[0] = 0;
another_zero[1] = 0;
const char *cstr = zero.c_str();
printf("%d::%d", cstr[0], another_zero[0]);
assert(cstr[0] == another_zero[0]);
printf("%d::%d", cstr[1], another_zero[1]);
assert(cstr[1] == another_zero[1]);
//assert(cstr[2] == another_zero[2]);
delete[] another_zero;
}
int main()
{
cout << "Hello World" << endl;
make();
return 0;
}