#include <stdio.h>
struct Hoge
{
char *str;
};
struct Hoge make_struct( )
{
struct Hoge hoge;
hoge.str = "string"; // この文字列の有効範囲
return hoge;
}
int main( )
{
struct Hoge hoge = make_struct( );
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgSG9nZQp7CgljaGFyICpzdHI7Cn07CgpzdHJ1Y3QgSG9nZSBtYWtlX3N0cnVjdCggKQp7CglzdHJ1Y3QgSG9nZSBob2dlOwoKCWhvZ2Uuc3RyID0gInN0cmluZyI7IC8vIOOBk+OBruaWh+Wtl+WIl+OBruacieWKueevhOWbsgoJcHJpbnRmKCIlcFxuIiwgaG9nZS5zdHIpOwoJcmV0dXJuIGhvZ2U7Cn0KCmludCBtYWluKCApCnsKCXN0cnVjdCBIb2dlIGhvZ2UgPSBtYWtlX3N0cnVjdCggKTsKCglwcmludGYoIiVwXG4iLCBob2dlLnN0cik7CglwcmludGYoIiVzXG4iLGhvZ2Uuc3RyKTsKCXJldHVybiAwOwp9Cg==