About 30 chapters on C++ doubts

Discussion in 'C++' started by parag_paul@hotmail.com, Jun 9, 2008.

  1. Guest

    , Jun 9, 2008
    #1
    1. Advertising

  2. Guest

    , Jun 9, 2008
    #2
    1. Advertising

  3. peter koch Guest

    On 9 Jun., 15:14, "" <>
    wrote:
    > http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on...
    >
    > 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
     
    peter koch, Jun 9, 2008
    #3
  4. Guest

    On Jun 10, 12:28 am, peter koch <> wrote:
    > On 9 Jun., 15:14, "" <>
    > wrote:
    >
    > >http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on...

    >
    > > 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


    I actually want to get them correct over time. This is not a paste and
    forget attempt from me.
    I will keep asking them individually over a period, start discussions
    and get to the bottom of all of them.
    This is an attempt to solve problems when a question and probable
    asnswer is in hand. In the forums like this I typically come across a
    visible network of though processes. Not everybody thinks same, no
    geography or demography explains or demarks itself in their anwering
    methods, but experts differ and they produce scenarios .
    I really enjoy being able to get in touch with you, who make so much
    difference to the answers I have

    I appreciate it
    -Parag
     
    , Jun 9, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Ym9iYnk=?=

    fable the lost chapters wont work

    =?Utf-8?B?Ym9iYnk=?=, Nov 18, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    599
    Scott M.
    Nov 19, 2006
  2. Nick Matzke

    Comparing two book chapters (text files)

    Nick Matzke, Feb 5, 2009, in forum: Python
    Replies:
    1
    Views:
    304
    andrew cooke
    Feb 5, 2009
  3. Replies:
    0
    Views:
    683
  4. Replies:
    1
    Views:
    1,191
  5. nanothermite911fbibustards

    >>> Assembler Book - Read or Download Individual Chapters - Volume 5

    nanothermite911fbibustards, Jul 16, 2010, in forum: C Programming
    Replies:
    0
    Views:
    343
    nanothermite911fbibustards
    Jul 16, 2010
Loading...

Share This Page