Up |
|
|
  |
Author: Taras_96Taras_96
Date: Apr 24, 2008 23:54
Hi all,
Jesse Liberty writes:
"Note that the String class provides the operator+. The designer of
the Employee class has
blocked access to the operator+ being called on Employee objects by
declaring that all the string
accessors, such as GetFirstName(), return a constant reference.
Because operator+ is not (and
can't be) a const function (it changes the object it is called on),
attempting to write the following will
cause a compile-time error:
String buffer = Edie.GetFirstName() + Edie.GetLastName();"
(the String class he refers to is a custom String class coded for
demonstration purposes)
I agree that the line will cause a compile time error because operator
+ isn't defined as a const method:
constString.operator+(anotherConstString) <- will not compile
|
| Show full article (1.05Kb) |
|
| |
6 Comments |
|
  |
Author: vickyvicky
Date: Apr 24, 2008 23:11
EARN FROM YOUR P.C . WORK FROM YOUR HOME. THE WELL PAID ONLINE MAKING
PROGRAMME INVITES YOU TO WORK WITH THEM AND GET PAID FOR YOUR WORK.YOU
CAN EARN $2,00,000 IN A SINGLE WEEK. THE LINK IS BELOW
www.jeeva235.blogspot.com
THE BIGGEST OPPORTUNITY FOR YOU
|
| |
|
| |
no comments
|
|
  |
Author: nkomlinkomli
Date: Apr 24, 2008 19:56
My goal is to allow users to enter in an equation that will be
calculated. In order to do this I’ve attached a parser to the program.
Unfortunately the equation has to be calculated millions of times. For
example
while(count !=limit)
{
Xnext= x+1;
x=xnext;
}
The parser is called to recalculate the equation every cycle which I
believe is the reason is why the program is as slow as Christmas. I
was wondering if there was any way to store the equation once it is
parsed to allow it to run at least close to the speeds it would of the
equation was hardcoded.
Here is the relevant part of the code in this example assume args and
args2 are x+1 and y+1.
int calculate()
{
|
| Show full article (1.76Kb) |
|
3 Comments |
|
  |
|
|
  |
Author: osama178osama178
Date: Apr 24, 2008 13:43
Let's say I have this code
--------------------
class GenericQueue
{
public:
bool Pop(void*& refToPtr); //--------------(1)
};
class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return
GenericQueue::Pop(refToPtr); /
--------------------(2)
}
};
Why does the statement in (2) generate an error?
|
| |
|
6 Comments |
|
  |
Author: osama178osama178
Date: Apr 24, 2008 13:37
Let's say I have this code
--------------------
class GenericQueue
{
public:
bool Pop(void*& refToPtr); // //--------------------(1)
};
class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return
GenericQueue::Pop(refToPtr); /
--------------------(2)
}
};
Why doesn't the statement in -------(2) compile?
|
| |
|
23 Comments |
|
  |
Author: osama178osama178
Date: Apr 24, 2008 13:23
Let's say I have this code
--------------------
class GenericQueue
{
bool Pop(void*& refToPtr); // //--------------------(1)
};
class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return GenericQueue::Pop(refToPtr); //--------------------(2)
}
};
.... The statement in (2) generates an error.
I know it doesn't compile because we're passing a pointer in (2) to a
function that expects a reference to a pointer, but as soon as we go
into the code block in (2), refToPtr becomes just the pointer. How do
I get it as a reference to pointer so I can pass it correctly?
|
| Show full article (0.62Kb) |
|
no comments
|
|
  |
Author: service0093service0093
Date: Apr 24, 2008 12:56
"Juro" is a newer series that resembles the "Museum," but features a
smaller face and more subtle diamond inlays. The men's "Esperanza"
model is the most complex luxury model with the three minute, second
and tenth-of-a-second sub-dials.
The 800 Series is a colorful line of sport watches for men and women
made out of durable stainless steel casing and has stick-like markers
for the obsessive time keeper or athlete. The Series 800 Chronograph
is the ultimate sports watch, with three round sub-dials accurately
measuring minutes, seconds and tenths-of-a-second.
at: salereplicawatch.com
|
| |
|
no comments
|
|
  |
Author: unknownunknown
Date: Apr 24, 2008 10:59
Hi,
I'm having files with a name pattern like "log_record-YY-MM-DD" and i would
like to create a list of the files available.
I'm wondering how i can do this, any ideas?
Thank you!
Ron
--
weeks of software enineering safe hours of planing ;)
|
| |
|
4 Comments |
|
  |
|
|
  |
Author: VolsVols
Date: Apr 24, 2008 10:26
char s[7] = "1234567";
when we use C compiler (gcc), it works fine.
An error is reported if using C++ compiler (g++).
any story for this one?
Vol
|
| |
|
16 Comments |
|
|
|
|
|