#include <stdio.h>
#include <stdlib.h>
void copia(int *vet, int tam, int *retorno) {
for(int i = 0; i < tam; i++)
retorno[i] = vet[i];
}
int main(void) {
int tam = 3;
int *vet
= malloc(tam
* sizeof(int)); int *novo
= malloc(tam
* sizeof(int)); vet[0] = 1;
vet[1] = 2;
vet[2] = 3;
copia(vet, tam, novo);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnZvaWQgY29waWEoaW50ICp2ZXQsIGludCB0YW0sIGludCAqcmV0b3JubykgewogICAgZm9yKGludCBpID0gMDsgaSA8IHRhbTsgaSsrKQogICAgICAgIHJldG9ybm9baV0gPSB2ZXRbaV07Cn0KCmludCBtYWluKHZvaWQpIHsKCWludCB0YW0gPSAzOwogICAgaW50ICp2ZXQgPSBtYWxsb2ModGFtICogc2l6ZW9mKGludCkpOwogICAgaW50ICpub3ZvID0gbWFsbG9jKHRhbSAqIHNpemVvZihpbnQpKTsKICAgIHZldFswXSA9IDE7CiAgICB2ZXRbMV0gPSAyOwogICAgdmV0WzJdID0gMzsKCWNvcGlhKHZldCwgdGFtLCBub3ZvKTsKCXByaW50ZigiMCAtPiAlZFxuIiwgbm92b1swXSk7CglwcmludGYoIjEgLT4gJWRcbiIsIG5vdm9bMV0pOwoJcHJpbnRmKCIyIC0+ICVkXG4iLCBub3ZvWzJdKTsKCWZyZWUobm92byk7CglyZXR1cm4gMDsKfQo=