Answers for "trailing spaces fgets"

0

trailing spaces fgets

char str[100] ;
    int i ;
    fgets ( str , sizeof(str) , stdin ) ;
    for ( i=strlen(str) ; i>0 ; i-- )
    {
            if ( str[i] == '\n' )
            {
                    str[i]='\0';
                    break ;
            }
    }
Posted by: Guest on October-11-2021

Code answers related to "trailing spaces fgets"

Browse Popular Code Answers by Language