Hello , Why i am getting "warning: format not a string literal and no format arguments [-Wformat-security]"


  • -1
    A

    void reverse(int start,int end, char s[])
    {

    for (;start<end; start++, end--)
    {
        s[start] ^= s[end] ;
        s[end]   ^= s[start] ;
        s[start] ^= s[end] ;
    }
    

    void reverseWords(char *s) {
    int i=0;
    int start=0;
    int l=strlen(s);
    reverse(0,l-1,s);
    while (i<l){
    start=i;
    while(s[i]!=' ' && s[i]!='\0')
    i++;
    reverse(start,i-1,s);
    while(s[i]==' ')
    i++;
    }
    }


  • 0

    Asking for help but can't even be bothered to make the code readable? Really? Please format that properly. As a bonus, in this particular case, that will likely even show you your problem.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.