I have a program assignment where one part requires a user-defined function where you enter a string with a minimum length of 2 characters and a maximum length of 20 characters. How would I get it to find the length (I believe should be stored into index) of the entered string s2 with only stdio functions and test to see if it meets the requirements?
void replacementstring(char s2[30], char c, int index)
{
printf("Enter Replacement String: ");
gets(s2);
while(index<2 || index>20)
{
if (index<2)
{
printf("Below the minimum number of characters.");
gets(s2);
}
if (index>20)
{
printf("Above the maximum number of characters.");
gets(s2);
}
}
}