devxlogo

Tip Bank

How does one overload operator->*()?

Question: How does one overload operator->*()? Answer: Here is an example:struct bar { void doSomething();}struct foo { bar *operator ->* () { return bar_; }}void Foo (){ void (bar::*barFn)() =

Type casting

Question: I’ve read the following example about type casting: int i; float f; f=float(i);Can you explain what happens to variables f and i on line 3, and could you give

Truncating and converting floats

Question: I am trying to truncate and then convert a float to a string. Something like atoi().Is this possible? Any suggestions? Answer: float f = 1.234;int i = f;strstream s;s

Template functions in classes

Question: Can I overload the >> operator in a class for all integral types using a template? If so, how? Answer: The short answer is no.The long answer?Templates are mechanisms

Stacking frames

Question: Can you tell me how to stack frames? I am currently using three frames and need to add a fourth. My layout looks like this:TopLeft | ContentI need to

C++: truncating and converting floats

Question: I am trying to truncate and then convert a float to a string. Something like atoi().Is this possible? Any suggestions? Answer: float f = 1.234;int i = f;strstream s;s

NetWare Directory Maps

Question: What are directory maps and how can I use them? Answer: Directory maps are an exciting new feature with IntranetWare 4.11 that allow users to map server directories effortlessly,