|
hi,
i know how to count number of objects created for class using static variable,
but i came to know that there is other way i.e using container class,
can any one specify how it is and if any code it will be helpfull or even links are
accepted..
iam attending interviews these questions asked for me.. so please helpme.. ( i answered this but dont know how to write code for this).
|
|
|
|
|
Have you heard about Google [^]?
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]
|
|
|
|
|
hello pallini ,
i know google is there then y is code project is there c i can even post here right which i fell is the best so never try to answer like this is u dont feel of answering then please never ever try.
( i belive in code project and myself and also internet so no need of ur answers any more)hope u got what i mean.
then if google is there then y code project is needed ?
|
|
|
|
|
hawk23reddy wrote: so never try to answer like this is u dont feel of answering then please never ever try.
And why? Is it the "hawk23reddy's rule"? Do you really think I will follow it?
hawk23reddy wrote: i belive in code project and myself and also internet so no need of ur answers any more
I'm happy about.
hawk23reddy wrote: hope u got what i mean.
Possibly, you know, I'm a "rather dull child"...
hawk23reddy wrote: then if google is there then y code project is needed ?
Both are useful. And they are more useful if you post the right question to the right one, I suppose.
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]
|
|
|
|
|
thankx,, what to do myan iam poor in lang...
|
|
|
|
|
hawk23reddy wrote: thankx,, what to do myan iam poor in lang...
I don't know. On the other hand, I'm pretty sure that your previous post was a bit rude. Anyway I don't care.
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]
|
|
|
|
|
Hi,
a container or collection holds/stores a number of objects.
The STL library provides a number of containters.
#include <vector>
class MyObject
{
public:
MyObject() {}
void DoSomething() {}
};
void main()
{
std::vector<MyObject*> vecList;
vecList.push_back(new MyObject);
vecList.push_back(new MyObject);
vecList.push_back(new MyObject);
int count = vecList.size();
}
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
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
|
|
|
|