|
Create a static int variable inside the class.
Increment it in the constructor and decrement it in the destructor.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hi
this code causes segmentation fault can u pleases y.
class ab
{
public:
virtual void abb()=0;
};
class bc : public ab
{
public:
void abb()
{
cout<<"here";
}
};
void get(ab* c)
{
bc *cc = new bc();
c = cc;
}
int main()
{
ab *b = NULL;
get(b);
b->abb();
}
but how can i solve this so that i need to fill derived class object (reference or pointer) to base class in get function only..
[my request]
if u feel iam very poor in basics
for give me plz by only this
i can learn more and attain like u
[/my request]
modified on Tuesday, May 19, 2009 2:03 AM
|
|
|
|
|
First of all, you have forgotten to derive bc from ab here.
hawk23reddy wrote: class bc
Secondly, change the signature of get from
hawk23reddy wrote: void get(ab* c)
to
hawk23reddy wrote: void get(ab** c)
and while calling get, pass address of b as argument.
|
|
|
|
|
Try this:
...
void get(ab* &c)
...
Research passing arguments to functions and especially passing arguments by reference.
|
|
|
|
|
|
Hi...
I am going to convert my codings Visual c++ to java...
I just want to know ..
Do we have any function in java which equivalent to [ GetPixe() in Visual C++ ] ...
thanks in advane
|
|
|
|
|
|
Please provide sourcecode: identification, management mouse, keyboard, VGA
sourcecode divided into multiple drives disk
Register contains API functions: to create windows, shutdown
The source on the new machines to complete, there are Operating System
Thanks
|
|
|
|
|
Need build skynet. Please send code.
|
|
|
|
|
You should choose the joke icon for such a post.
Alternatively you might read forum posting guidelines [^], before doing it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Did you notice the member icon of this guy? It says "financialadmin". WTF?
|
|
|
|
|
Had reported in the suggestions forum. Fixed now.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Can any one knows?
How to search access database and display first related records on screen using C++.
Please help.
Thanks
|
|
|
|
|
Imran7 wrote: 1) How to search access database and 2) display first related records...
This is a two-part question. Please be more specific.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Ok, needs to read access data base. [already did]
now I have five records in 2D array.
Wants to search position [records already sorted] and insert weighted number and leave the 2D array sorted.
Please help............
Thanks
|
|
|
|
|
I have a bitmap on a toolbar that opens up a dialog when clicked. I wanted to add a (Ctrl+E) shortcut as another option to open it, I did add this shortcut to it in its ID properties in the Resource project...But how come it doesn't work? Is there extra code thats need to have the shortcut come alive? Am I missing something?
Thanks
sft
|
|
|
|
|
Are you referring to a keyboard accelerator?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes, just like Ctrl+p does the print and so on. I would like to attach Ctrl+E to a bitmap icon on my mainMenu Toolbar.
sft
|
|
|
|
|
Check out LoadAccelerators() and related functions. You might just be able to add an accelerator resource to your project.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have done this before without adding any code, just can't remember how...its nothing but adding a shortcut to an ID in other words.
sft
|
|
|
|
|
Software2007 wrote: ...its nothing but adding a shortcut to an ID in other words.
A mnemonic, perhaps?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You were right the first time, I just needed to map in the Accelerator table.
I do have another simple question as I am not very familiar with MFC toolbars, How can I load up or insert an existing bitmap to the existing Main Application Tool Bar, because, I would like to add a bitmap there and I don't feel like editing and drawing it,while I can just download it from somewhere.
Thanks
sft
|
|
|
|
|
Hey, Can you recommend me what C++ library or classes are available for sending email via SMTP in C++. I'm on Windows platform. I need a library which supports attachments and SSL connections. What are the options available. I'm not into implementing my own
Oh I forgot to mention I'm using Visual C++ 6
Regards
|
|
|
|
|
Have you searched here at CP?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes, I found few but none met the requirement (SSL, Visual C++ 6).
|
|
|
|