#include <stdio.h>
#include <string.h>
int main(void){
//Teste para copia com menos caracteres que o numero indicado
char foo2[] = "outra string!!!";
printf("\nFoo (lixo): %s\n", foo2
); //Foo (lixo): outra string!!! printf("\nFoo: %s\n", foo2
); //Foo: BOING 737
//Teste para copia com mais caracteres que o numero indicado
char foo[] = "outra string!!!";
printf("\nFoo (lixo): %s\n", foo
); //Foo (lixo): outra string!!! printf("\nFoo: %s\n", foo
); //Foo: BOING string!!!
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBtYWluKHZvaWQpewoKCS8vVGVzdGUgcGFyYSBjb3BpYSBjb20gbWVub3MgY2FyYWN0ZXJlcyBxdWUgbyBudW1lcm8gaW5kaWNhZG8KCWNoYXIgZm9vMltdID0gIm91dHJhIHN0cmluZyEhISI7CglwcmludGYoIlxuRm9vIChsaXhvKTogJXNcbiIsIGZvbzIpOyAvL0ZvbyAobGl4byk6IG91dHJhIHN0cmluZyEhIQoJc3RybmNweShmb28yLCAiQk9JTkcgNzM3IiwgMTApOwoJcHJpbnRmKCJcbkZvbzogJXNcbiIsIGZvbzIpOyAvL0ZvbzogQk9JTkcgNzM3CgkKCS8vVGVzdGUgcGFyYSBjb3BpYSBjb20gbWFpcyBjYXJhY3RlcmVzIHF1ZSBvIG51bWVybyBpbmRpY2FkbwoJY2hhciBmb29bXSA9ICJvdXRyYSBzdHJpbmchISEiOyAKCXByaW50ZigiXG5Gb28gKGxpeG8pOiAlc1xuIiwgZm9vKTsgLy9Gb28gKGxpeG8pOiBvdXRyYSBzdHJpbmchISEKCXN0cm5jcHkoZm9vLCAiQk9JTkcgNzM3IiwgNSk7CglwcmludGYoIlxuRm9vOiAlc1xuIiwgZm9vKTsgLy9Gb286IEJPSU5HIHN0cmluZyEhIQoJCglyZXR1cm4gMDsKfQ==