This code works in VisualC++, and if I enter too many letters it just truncates the string; but in gcc I get a buffer overflow and the program crashes. ?? Is there a better way to take user input and crop it as a string of a specified yet variable size?Code:fflush(stdin); for (i=0; i<=length-1; i++) {if (i<=length-1){c=getchar(); input[i]=c;}} input[length]=0;