#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main()
{
char** array
= malloc(1 * sizeof(*array
));
if (array)
{
array[0] = "This";
printf("%s\n------\n", array
[0]);
char** tmp
= realloc(array
, 2 * sizeof(*array
)); if (tmp)
{
array = tmp;
array[1] = "That";
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzdGRpby5oPgoKaW50IG1haW4oKQp7CiAgICBjaGFyKiogYXJyYXkgPSBtYWxsb2MoMSAqIHNpemVvZigqYXJyYXkpKTsKCiAgICBpZiAoYXJyYXkpCiAgICB7CiAgICAgICAgYXJyYXlbMF0gPSAiVGhpcyI7CgogICAgICAgIHByaW50ZigiJXNcbi0tLS0tLVxuIiwgYXJyYXlbMF0pOwoKICAgICAgICBjaGFyKiogdG1wID0gcmVhbGxvYyhhcnJheSwgMiAqIHNpemVvZigqYXJyYXkpKTsKICAgICAgICBpZiAodG1wKQogICAgICAgIHsKICAgICAgICAgICAgYXJyYXkgPSB0bXA7CiAgICAgICAgICAgIGFycmF5WzFdID0gIlRoYXQiOwoKICAgICAgICAgICAgcHJpbnRmKCIlc1xuIiwgYXJyYXlbMF0pOwogICAgICAgICAgICBwcmludGYoIiVzXG4iLCBhcnJheVsxXSk7CiAgICAgICAgfQoKICAgICAgICBmcmVlKGFycmF5KTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==