P
parag_paul
http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on-my-blog.html
Try this one for 30 chapters on C++ doubts,
Try this one for 30 chapters on C++ doubts,
http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on...
Try this one for 30 chapters on C++ doubts,
http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on...
Try this one for 30 chapters on C++ doubts,
Try this one for 30 chapters on C++ doubts,
The first entry I took was item 20, which had item #93 as its first
item:
93. Why qsort is Still Useful in C++
C++ defines a set of generic algorithms such as sort and find.
However, the corresponding C algorithms, qsort and bsearch, are still
useful in C++ programs for at least three reasons:
• Legacy code. Familiarity with C algorithms is needed to maintain
legacy C code.
[you had that one right]
• Efficiency. You cannot apply STL algorithms to items that are not
stored in an STL container. [ wrong! ]
To apply these algorithms to a built-in array, you first have to copy
it into a container [ wrong! ]
--an operation that incurs runtime overhead.
• Applicability to non-OO data types. STL algorithms rely on operators
== and >.
[ wrong! ]
However, these operators are either meaningless or not defined when
applied to plain structs or built-in arrays. C algorithms do not rely
on these operators to work.
So for that one item you had three wrongs and one right.
I hope you remove those pages - a beginner might find them and believe
you.
/Peter
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.