|
Two linked lists intersect sometimes. What does this mean? They have the same value at intersection or?
Set 1: 1, 2, 3, 4
Set 2: 5, 6, 7, 9, 2
If I store these values in two linked lists, does it mean they have to intersect at 2 or does it mean something else.
|
|
|
|
|
CodingYoshi wrote: Two linked lists intersect sometimes. What does this mean?
Couldn't you ask your teacher, could you?
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]
|
|
|
|
|
You are making an assumption that everyone has access to a teacher. I googled and found many articles about how to find the intersection of two linked lists but none which explain why would they intersect and when/why would you want them to intersect. A real life example will help.
I have been programming for quiet a while but I never had to find out if two linked lists intersect. BTW I mostly have been using managed languages.
|
|
|
|
|
I made such an assumption, because your request looked like an homework assignment. I may be wrong, occasionally.
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]
|
|
|
|
|
In set theory, the intersection on two sets is a third set that contains all the elements the first two have in common.
Steve
|
|
|
|
|
CodingYoshi wrote: What does this mean?
It means it's a coincidence that both lists contain a node having the value 2.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Okay lets reword the question. Why would someone want the linked lists to intersect? Advantages or Disadvantages?
|
|
|
|
|
CodingYoshi wrote: Why would someone want the linked lists to intersect?
No reason that I can think of. Yes it's possible, but I've never heard of such an implementation. If you are visualizing something like:
class set : public list
{
}; This says that a set is-a list, which it can't be because a set does not do everything that a list does. Perhaps you wanted a has-a construct where the set contains a list.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Lets forget sets and concentrate why linked lists would intersect and why/when would someone do this.
|
|
|
|
|
CodingYoshi wrote: Lets...concentrate why linked lists would intersect and why/when would someone do this.
I already answered that.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
If It's difficult to explain here, you can direct me to a link or something on that.
Thank you masters!
|
|
|
|
|
LIKE THIS...[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Congratulations! You're a GOLD member now?
Thank you masters!
|
|
|
|
|
Thank you but gold member is not new!
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi everyone!
I'm using CDatabase & CRecordSet (ODBC in MFC) and I wonder how can I save the content of an RichEdit control as a record (or better to say: a field) in MS-Access database (*.mdb).
Thank you masters!
|
|
|
|
|
You probably want a field that's a BLOB type (I guess Access would call that Attachment type?), then you can just store the raw bytes of the CRichEdit control (accessed via the CRichEditCtrl::StreamIn [^] and CRichEditCtrl::StreamOut [^] methods) in that field, specifying some of your code in the pfnCallback field of the EDITSTREAM [^] structure you pass to the method.
Of course, you could just store the text (as opposed to the rich text, but accessed via the same methods) in a sufficiently large Text field.
|
|
|
|
|
Access has a OLE Object field type. That is used to hold large, binary data.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
U want to extract text from the ms word document using vc++
Can anybody please help me
Thanks in advance
|
|
|
|
|
AVIHAR wrote: U want to extract text from the ms word document using vc++
No
AVIHAR wrote: Can anybody please help me
Search for "Word Automation" @ GOOGLE[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Import Word's type library into your project. This will add a bunch of Word-related classes to your project. Then you can start with something like:
_Application app;
if (app.CreateDispatch("Word.Application") == TRUE)
{
Documents docs = app.GetDocuments();
_Document doc = docs.Open(COleVariant("thesis.doc"), vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional);
docs.Close();
app.Quit();
}
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am writing an application using C++ and MFC. A few weeks ago, I wrote the following
line of code:
<br />
IMPLEMENT_SERIAL( CMainWindow, CFrameWnd, 1 )<br />
The code worked. The class CMainWindow has only one constructor and that constructor does not take any arguments. Today, I changed that constructor to take a single argument, a reference to an
fstream object. Now, I get the following error messages from the compiler on the line shown above.
There error messages are:
<br />
error C2512: 'CMainWindow' : no appropriate default constructor available<br />
error C2758: 'CMainWindow::debugFile' : must be initialized in constructor base/member initializer list<br />
Note that debugFile is the name of the formal parameters for the constructor CMainWindow. I would
really like to be able to serialize the class CMainWindow and at the same time, I would like the class constructor to take one argument. What should I do?
Thanks
Bob
|
|
|
|
|
You should follow the 'suggestions' of the two errors, in order to make your class serializable again.
For instance, the documentation [^] states
Defining a Constructor with No Arguments
MFC requires a default constructor when it re-creates your objects as they are deserialized (loaded from disk). The deserialization process will fill in all member variables with the values required to re-create the object.
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]
|
|
|
|
|
CPallini wrote a very nice version of "Tough".
The serialisation mechanism is very good for simple objects, but I've found it to be very fragile when you want to do any real work. I know others here disagree with me on this though!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks for the responses. It seems to me that the MFC serialization approach is less then ideal. I solved the problem by making the argument to the constructor optional. This is also less than ideal it gets the job done.
Bob
|
|
|
|