First  |  Prev |  Next  |  Last
Pages: 186 187 188 189 190 191 192 193 194 195 196 197 198 199
no appropriate default constructor available
When writing the following code: class Base { Base(const Base &rhs) {} ~Base(); }; void f() { Base b; }; The compiler shouts: no appropriate default constructor available But when changing it to: void f() { Base b(); }; it compiles. Why? [ See http://www.gotw.ca/resources/clcm.htm f... 18 Feb 2006 07:25
Syntax of pure virtual function definition
why is this allowed : class Base { public: virtual void f() = 0; }; void Base::f() { cout << "bla"; } When this is not: class Base { public: virtual void f() = 0 { cout << "bla"; } } [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. Fir... 12 Feb 2006 05:31
random number [0, 99]
Hi, I am using the int version of rand() with MS Visual Studio. I would like to generate random number in the range of [0, 99]. Right now I am using rand() * 100 / (RAN_MAX + 1) I found that I got too much 0. 0 appears more than any other numbers. How can I fix it? Thanks, qq [ See http://www.... 19 Feb 2006 06:49
Proposal: Making C++ more like Java
////////////////////////////////////////////////////////////////////// /// /// Java is elegant how it method declarations and method definitions /// are merged into one concept, and consequentally there is no need /// for header files. /// /// Wouldn't it be good if a C++ preprocessor could be written that /// t... 20 Feb 2006 06:41
Multi key Maps
Hi , I always find the usage of "if" statement annoying.. Just as it is the source for good amount of bugs... The regular map has a key and a value. I can find a value by the key. Is there any standard data structure which can stores two Keys, and when I ask with one key it gives me other Key? i.e: map[k1] ... 8 Feb 2006 08:55
Atexit() and C++
Hello, when I try to use atexit() from a C++ class, my compiler is giving me an error. error C2664: 'atexit' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)' Is it possible to use atexit() with a C++ class member or only with global functions? Thank you in advance, Marco ////... 6 Feb 2006 05:42
Functor versus function object
Hello, Is it correct to say 'functor' as a synonym for 'function object' in C++? Thanks. Jim [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 5 Feb 2006 13:46
How to specialize function template when
Hi all, does anyone have an idea how to specialice a function template when the type does not occur in the parameter list ? Example: template <class T> class TheClass { private: std::string a_; std::string b_; public: void dosomething() { foo<T>( a_, b_... 4 Feb 2006 13:19
C++ String tokenizaer
Is there a recommend best solution for string tokenizing in C++? I mean, I know strtok() is bad, but's what's a good alternative? I've seen Boost tokenizers, but there's a hugh include overhead, which I don't want. Is there a simple class or function out there that's recommended by those in the nkow? Fanks ... 10 Feb 2006 06:14
Backgrounder on C++/CLI
I don't know how useful or on-topic this article is going to be for this NG, but considering there are many more discussion that are likely to spawned once C++/CLI gets accepted into the mainstream, I thought the C++ community might want to spend a few minutes looking into the design and ISO C++ compatibility goa... 3 Feb 2006 07:44
First  |  Prev |  Next  |  Last
Pages: 186 187 188 189 190 191 192 193 194 195 196 197 198 199