#include<stdio.h>
#include<stdlib.h>
void func(int *ptr, int x) {
for (int i = 0; i < x; i++) {
printf("Digite o valor %d do vetor\n", i
+ 1); }
}
int main () {
int x;
printf("Digite o numero de elementos que deseja\n"); int *ptr
= malloc(x
* sizeof(int)); func(ptr, x);
for (int i = 0; i < x; i++) {
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RkbGliLmg+CnZvaWQgZnVuYyhpbnQgKnB0ciwgaW50IHgpIHsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgeDsgaSsrKSB7CiAgICAgICAgcHJpbnRmKCJEaWdpdGUgbyB2YWxvciAlZCBkbyB2ZXRvclxuIiwgaSArIDEpOwogICAgICAgIHNjYW5mKCIlZCIsICZwdHJbaV0pOwogICAgfQp9CmludCBtYWluICgpIHsKCWludCB4OwoJcHJpbnRmKCJEaWdpdGUgbyBudW1lcm8gZGUgZWxlbWVudG9zIHF1ZSBkZXNlamFcbiIpOwoJc2NhbmYoIiVpIiwgJngpOwoJaW50ICpwdHIgPSBtYWxsb2MoeCAqIHNpemVvZihpbnQpKTsKCWZ1bmMocHRyLCB4KTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgeDsgaSsrKSB7CiAgICAgICAgcHJpbnRmICgiJWRcbiIsIHB0cltpXSk7CiAgICB9ICAgCiAgICBmcmVlKHB0cik7CglyZXR1cm4gMDsKfQ==