confused: static method const???

This is a discussion on confused: static method const??? within the C++ Programming forums, part of the General Programming Boards category; I'm working on this program and is such a slow progress, I keep stumbling on so small things... Like this ...

confused: static method const???

I'm working on this program and is such a slow progress, I keep stumbling on so small things... Like this one. My textbook is showing a class with private static int, and a public static method which is also const as it just displays the private member... I declared my own class, following the guidelines from the textbook and when I compile it (DevC++ 4.9.9.2) it tells me 34 C:\Dev-Cpp\inheritance_project\main.cpp static member function `static int MyString::numStrings()' cannot have `const' method qualifier
Why is that?
I wrote it as such:

Dev-CPP is not a compiler. It's merely an IDE, using the MinGW port, of the GNU GCC compiler. GCC is pretty standards compliant and widely used, meaning: you might as well try fix your code, not the compiler.

If "the book" claims a static const member function is valid C++ then, yes, it is wrong. If a code example in the book is of that form, then that example is wrong (which may mean the book is crap, or may just be an error in the particular example).

If they later drop the const all points out that it is a typo. It's probably already corrected in later editions (if there are any) or on some online errata, otherwise you might wanna consider sending the author an e-mail with that info.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell