-1
void read_vetor(int *vet, int n)
{
for (int i=0;i<n;i++)
{
scanf_s(" %d", *(vet+i));
}
}
void write_vetor(int* vet, int n)
{
for (int i=0;i<n;i++)
{
printf("%d", *(vet+i));
}
}
void main()
{
int a[4], b[4];
printf("Put values for a[4]: ");
read_vetor(a, 4);
printf("Put values for b[4]: ");
read_vetor(b, 4);
write_vetor(a, 4);
write_vetor(b, 4);
}
My error happens in the read_vector function, when I’m passing the pointer, but I can’t see why. Someone can help me?
Thank you for the reply!
– kappa