c++ question.

Jaime jtamate at gmail.com
Thu Sep 2 20:54:19 BST 2010

  I do not know what this methods do,
  They use a [-1] array index, perhaps to do pointer arithmetic?, but
I do not know, it is the first time I see negative indexes in C++

They are in kdebase/runtime/kioslave/man/man2html.cpp
lines 2845, 3166, 3661, 3693, 3732, 3791, 4067 and 4163.
Here you have an extract:of the first case...

    char *wordlist[max_wordlist];
    fill_words(c, wordlist, &words, true, &c);
    for (int i=0; i<words; i++)
        if ((mode) || (inFMode))
            out_html(" ");
        wordlist[i][-1]=' ';        <---------------- The unknown thing for me
        out_html( set_font( (i&1) ? font2 : font1 ) );

Best Regards.

More information about the kde-core-devel mailing list