|
piul wrote: Does the list re-arrange itself to fill that gap??
Yes and no. The good thing from a List vs an array is (in grosso modo): that every node is pointing to next and previous node. So when you delete one position, you dont have to rearrange anything, just modify 2 pointers the "next" in the previous node and the "previous" in the next node. Then the node in the middle is not in the list anymore and can be just deleted without problems.
piul wrote: Does it have to be done manually, remove a node, and then shift the rest of elements one position??
You dont have to move anything, a list is not an array.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
thanksfully it does, hey !!!
do you write classes letting the user manage its content himself ?
BTW, why don't you test it ?
|
|
|
|
|
Thankfully it is a list and not an array. Therefore, no shifting of elements is required for a delete operation. It is just changing where a single 'next' pointer is pointing to. For example, if you delete the 3rd element, what internally happens is, the next pointer of the second element points to the 4th element and so the 3rd one is 'dropped'.
A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
|
|
|
|
|
Rajesh R Subramanian wrote: A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
You're really a bad guy.
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
|
|
|
|
|
Bug crossing answers in other posts? or just abussing another time? :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
No abuz sir:
Rajesh mocks the poor newbie lady (I suppose), he's really bad.
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
|
|
|
|
|
CPallini wrote: You're really a bad guy.
You're really a bad guy. - CPallini
|
|
|
|
|
I think it's definitely time to restore your charming wavy sign.
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
|
|
|
|
|
[military tone] Sir! [/military tone]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
[bold military tone] Well done. Stand easy now! [/bold military tone]
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
|
|
|
|
|
piul wrote: What happens to a CList when using RemoveAt(POSITION) . Does the list re-arrange itself to fill that gap??
Yes.
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
|
|
|
|
|
So! Then, do I have to modify manually the Next pointer of the previous and the Prev pointer of the next or not??
I did do a test, and I think it didn't do this itself!
|
|
|
|
|
You don't have to do anything. You just call the RemoveAt(POSITION) and the rest of the dirty stuff is automatically done for you. Good know?
A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
|
|
|
|
|
piul wrote: So! Then, do I have to modify manually the Next pointer of the previous and the Prevpointer of the next or not??
Never do such weird things, man.
piul wrote: I think it didn't do this itself!
Never think such weird things, man.
BTW Don't you trust MFC ? (well, MFC containers are pretty ugly, but that's a completely different matter...)
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
|
|
|
|
|
CPallini wrote: well MFC containers are pretty ugly, but that's a completely different matter...
I am gonna have to beat you down for saying that. I'll have Mark on my side.
A 'C++' question asked in the Visual C++ forum:
Title: please stomuch me
if i have
string s[7];
s[1]="hello"
...
s[7]="how are you"
can i trace s[1] by loop and select specified item as example i, want to select e from s[1]="hello"..... the question is : this process possible or impossible!? I hope help me.......thanks - sofia_111
|
|
|
|
|
Rajesh R Subramanian wrote: I am gonna have to beat you down for saying that. I'll have Mark on my side.
And what about your guru Michael? Anyway even Mark & Michael are not enough, I have drugz on mine.
BTW do you really appreciate CList, CArray, CMap and so on? I think STL containers are much, much, much, much more better. Anyway, you know, this is going on my arrogant...
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
|
|
|
|
|
CPallini wrote: BTW do you really appreciate CList, CArray, CMap and so on? I think STL containers are much, much, much, much more better.
Unfortunately I agree with you.
But, however, I've developed love for MFC and it annoys me when someone abuses it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: I've developed love for MFC
Well I have to admit I don't like it a bit. But plz, plz, shhhhh, dont' tell Rajesh.
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
|
|
|
|
|
*CPallini and Rajesh goes for a coffee to celebrate it*
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: *CPallini and Rajesh goes for a coffee to celebrate it*
definitely
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
|
|
|
|
|
Rajesh R Subramanian wrote: *CPallini and Rajesh goes for a coffee to celebrate it*
you stop having tea?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
piul wrote: do I have to modify manually the Next pointer of the previous and the Prevpointer of the next or not??
Nope, as already told in other answers.
piul wrote: I did do a test, and I think it didn't do this itself!
I think your test was wrong. Sorry.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Your answers always is attractive.
|
|
|
|
|
Drugz, my friend.
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
|
|
|
|
|
i have added a resource symbol to the dialog and have added it to string table and i did the following code to have progressbar in status bar,but it does work,y is that so???i need to display the progressbar when i click the cancel button.
CStatusBar m_wndStatusBar;
static UINT BASED_CODE indicators[] =
{
PROGRESS
};
void progress::OnBnClickedOk()
{
m_bCreated = FALSE;
RECT MyRect;
m_wndStatusBar.GetItemRect(0, &MyRect);
if (m_bCreated == FALSE)
{
m_Progress.Create(WS_VISIBLE|WS_CHILD, MyRect, &m_wndStatusBar, 1);
m_Progress.SetRange(0,100);
m_Progress.SetStep(10);
m_bCreated = TRUE;
}
void progress::OnBnClickedCancel()
{
for (int I = 0; I < 100; I++)
{
Sleep(20);
m_Progress.StepIt();
}
RAJA
|
|
|
|