colon operation
-
ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!
-
ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!
Are you sure this is not a typo and it should be the conditional operator?
ilist_item *next = _current << _current **?** _current->next() : _current;
That does not look correct either, but it depends on the code, i.e. if_current != NULL
go to the next node, otherwise returnNULL
Of course I could be wrong:-O
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
-
ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!
it is accessing the constructor (maybe) of that object. My God is more powerfull Than Your God. (the line that divides the world)
-
Are you sure this is not a typo and it should be the conditional operator?
ilist_item *next = _current << _current **?** _current->next() : _current;
That does not look correct either, but it depends on the code, i.e. if_current != NULL
go to the next node, otherwise returnNULL
Of course I could be wrong:-O
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
I don't know if it is right I only got it from a book "C++ Primer 3rd" It is in sector 5.11.1 :(
-
I don't know if it is right I only got it from a book "C++ Primer 3rd" It is in sector 5.11.1 :(
I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
-
I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
Yes It is Only my book is translated into chinese. Those code may be found in A Linked List Example of chapter 5 Statements Great! Thanks!!!
-
it is accessing the constructor (maybe) of that object. My God is more powerfull Than Your God. (the line that divides the world)
The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as Mr. Ted Ferenc said: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!!
-
I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as you said, that is a conditional operator: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!! :)
-
The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as you said, that is a conditional operator: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!! :)
I can't say 100%, the simple test is to try and compile the code and step through using the debugger. What I think it is, is a class to iterate through a linked list, where _
current
is the current node,next_item()
checks if_current
has been defined is so get the next node, otherwise return_current
, which I asuume isNULL
Isn't C++ fun!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
-
ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!
You know.. that subject line sure looked suspicious for a forum like this. :rolleyes: -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.
-
You know.. that subject line sure looked suspicious for a forum like this. :rolleyes: -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.
We don't have a medical forum yet, Jörgen.;P "Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
-
We don't have a medical forum yet, Jörgen.;P "Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
True. I figure this forum can only treat missing semicolons and related issues. ;) -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.
-
I can't say 100%, the simple test is to try and compile the code and step through using the debugger. What I think it is, is a class to iterate through a linked list, where _
current
is the current node,next_item()
checks if_current
has been defined is so get the next node, otherwise return_current
, which I asuume isNULL
Isn't C++ fun!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
Yeah! C++ is very fun and it is abundant in perfect thinking!