char copy, array[20]
printf("enter ..."):
scanf("%s", array);
if (strlen(array) > 20 )
{
strcpy(copy, array....);
what would I need to do to make it only grab the first 20 character if the input is more then 20 character long
char array[20+1];
scanf("%20s", array);
Problem solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With