can someone please tell me why this piece of code does not work properly?...im trying to get input using getchar and put it into an array. then, print the contents of the array.
Code:#include <stdio.h> #include <ctype.h> #define ARRAY_SIZE 1000 int main(int argc, char **argv) { int input; char Description[ARRAY_SIZE]; int counter = 0; while((input = getchar()) != EOF) { Description[counter] = input; counter++; input = getchar(); } printf("%s",Description); return 0; }