![]() The use of the "static" keyword to declare class variables and methods is kindergarten C++, not "deep voodoo" that only gurus know about. It is only present in my example because the parent post used it, and things are generally clearer if a reply utilises the same idioms as the original.įinally, it pays to learn at least the rudiments of a language before publicly claiming that it cannot do something. The example above is however excusable due to the fact that is is returning a pre-compiled constant via a constant pointer - it is also both simple and understandable to those not familiar with the STL.Ģ) C library functions such as "printf" should also be avoided for the same reasons. Now call it, without an instanceġ) In general, C-style fixed length character arrays (and indeed C pointers of all types) should be avoided in C++, which together with the STL, has much more robust mechanisms that do most if not all of the same jobs. ![]() You obviously don't know how to program in C++: ![]() " In C++, I have to create an object instance if I want to call any class function, even if it's not specific to a particular instance." ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |