[Solved] How to read integers separated by a comma and a white space into an array in C [closed]
Try this: #include <stdio.h> void getInput(int sizeOfInput, int arr[]) { int i = 0; printf(“IN”); for(; i < sizeOfInput – 1; ++i) { scanf(“%d, “, &arr[i]); } scanf(“%d”, &arr[i]); printf(“OUT”); } main(){ int sizeOfInput = 0; printf(“Enter how many numbers do you want to enter?”); scanf(“%d”, &sizeOfInput); int arr[sizeOfInput]; getInput(sizeOfInput, arr); } Sorry I am … Read more