Doubts about Dynamic Allocation

Asked

Viewed 24 times

1

As I can in C pick up a variable, as in the example below, make N = vector.

In case I go to play N in another role and put inside a for, and then want to reallocate the vector value by increasing N times. And thus increasing N propositionally. To be able to insert more data into the loop

And another question how I pass this variable vector by reference function?

scanf("%i", &N);  
vetor = malloc(N * sizeof(int)); //vetor de struct

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.