I am using a do while loop to read input using scanf and putting each char into an array slot, and i want to stop when the person hits the return key
why doesnt this work, does the while stament not recognize the incremnet of i?Code:main() { char input[MAX]; char ch; int i = 0; printf("Enter input:\n"); do { scanf("%c", &input[i]); i++; } while(input[i] != '\n'); }
Thanks