Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 25
java x 1
Member Avatar for dophine

Hi, Since small object allocation in heap is bad, I am just wondering the range of the object size that is defined to be small. Regards, Michael

Member Avatar for dophine
0
261
Member Avatar for dophine

Hi, I have the following code. and it works fine. [CODE] class base { public: base() {}; virtual ~base() {}; virtual void foo() = 0; virtual void boo() = 0; }; class derive2 : public virtual base { public: derive2() {}; virtual ~derive2() {}; virtual void foo() {}; }; class …

Member Avatar for Fbody
0
181
Member Avatar for dophine

Hi All, I just read the book called "C++ coding stardards - 101 rules". And Found there is something I don't understand. [CODE]class FlagNth { public: FlagNth( size_t n ) : current_(0), n_(n) {} // evaluate to true if and only if this is the n-th invocation template<typename T> bool …

Member Avatar for dophine
0
117
Member Avatar for dophine

Hi all, I don't quite understand the program print the following output. [CODE] class D { public: D(int j):i(j){printf("default %d\n", i);}; D(const D& d):i(d.i){printf("copy %d\n", i);}; private: int i; }; int main(int argc, char** argv) { D d = 2; D d1 = D(23); } [/CODE] output: default 2 default …

Member Avatar for mike_2000_17
0
105
Member Avatar for dophine

Hi all, I am not sure whether the member variables of singleton class should be protected for multhread since I just read some code from colleague. I think it should be.

Member Avatar for Tom Gunn
0
41
Member Avatar for dophine

Hi all, I just wrote a small problem to check gettimeofday in a multi-cores environment. [code] int timediff(double fTimeQvs, double fTimeTcp) { int iTimeDiff; iTimeDiff = (((((int)fTimeQvs)/10000) - (((int)fTimeTcp)/10000)) * 3600) * 1000000; iTimeDiff += ((((((int)fTimeQvs)/100)%100) - ((((int)fTimeTcp)/100)%100)) * 60) * 1000000; iTimeDiff += ((((int)fTimeQvs)%100) - (((int)fTimeTcp)%100)) * 1000000; iTimeDiff …

Member Avatar for Salem
0
196
Member Avatar for dophine

Hi all, there is a JTable and the cell in one column is set to button by set a customize cell render. However, the size of the button occupies the whole cell region that is not what I want. How can I set fix size to it? Thanks

Member Avatar for Ezzaral
0
122
Member Avatar for dophine

Hi all, there is a big project which consists of different folders and makefile. I want to build just part of the project using eclipse since every time I build is to build the whole project. Is there anyone knowing how to do?

0
49
Member Avatar for dophine

Hi all, I would like to know in what situation template is used instead of inheritance and vice visa. examples are appreciated. I just know template is static binding while inheritance is dynamic binding. so if speed is concern, template is better.

Member Avatar for Narue
0
133
Member Avatar for tones1986

Hey folks. I am confused as to how i can make a constructor take zero - or lets say 3 arguments. If i do this in my main.cpp: [code] const Vector v1; const Vector v2(1.0, 2.0, 3.0); [/code] And this in my vector.cpp file: [code] Vector::Vector(double new_x, double new_y, double …

Member Avatar for dophine
0
87
Member Avatar for dophine

I have a question related to function. fun(const int);<-- pass a const int const int fun(int);<--return a const int but what is "fun(int) const"?

Member Avatar for Dave Sinkula
0
97
Member Avatar for dophine

Hi when I look at this website [url]http://www.parashift.com/c++-faq-lite/operator-overloading.html[/url], I don't quite understand for the section 13.14 about prefix++ and postfix++. Number x = /* ... */; ++x; // calls Number::operator++(), i.e., calls x.operator++() x++; // calls Number::operator++(int), i.e., calls x.operator++(0) why ++x is calling x.operator++() while x++ is calling calls …

Member Avatar for dophine
0
134