The get function does not limit the amount of text coming from stdin . If there are more than 63 characters from stdin , an overflow will occur. Gets discards the LF char, which will be the [Enter] key, but adds char to the end, so the limit is 63 characters.
If the inp value is filled with 64 non-zero characters, because it can be directly accessed, the showlen function will cause an access violation because strlen will look for a null-char above inp to determine its size.
Using fgets would be a good solution for the first problem, but it would also add an LF char and a null value, so the new limit of readable text would be 62.
Secondly, just take care of what is written in inp .
source share