Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

reading arrays from stdin c

int n;
int *numbers;

scanf("%d", &n);

numbers = malloc(n * sizeof(*numbers));

for (int i=0; i<n; i++)
    scanf("%d", &numbers[i]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reading #arrays #stdin
ADD COMMENT
Topic
Name
1+8 =