More Effective C++

Discussion in 'C++' started by barcaroller, Apr 13, 2007.

  1. barcaroller

    barcaroller Guest

    I was thinking of buying Scott Meyer's second book (More Effective C++) and
    noticed that it has not been updated since 1995 (unlike his other two famous
    books). Does anyone know (rumour or otherwise) if a new edition is coming
    out. I would hate to spend $50 today only to see a new edition on the
    shelves tomorrow.
     
    barcaroller, Apr 13, 2007
    #1
    1. Advertising

  2. barcaroller

    bark Guest

    On Apr 13, 10:09 am, "barcaroller" <> wrote:
    > I was thinking of buying Scott Meyer's second book (More Effective C++) and
    > noticed that it has not been updated since 1995 (unlike his other two famous
    > books). Does anyone know (rumour or otherwise) if a new edition is coming
    > out. I would hate to spend $50 today only to see a new edition on the
    > shelves tomorrow.


    you could ask him directly

    http://www.aristeia.com/books_frames.html
     
    bark, Apr 13, 2007
    #2
    1. Advertising

  3. barcaroller

    Ian Collins Guest

    Re: Fast and Safe C Strings: User friendly C macros to Declare anduse C Strings.

    Clem Clarke wrote:
    > Some 20 years ago, it became clear that C strings were not as safe, nor
    > as fast, as strings in PL/I, Assembler or Pascal.
    >

    C++ has a solution, std::string. Did you intend to post to comp.lang.c?

    --
    Ian Collins.
     
    Ian Collins, Apr 13, 2007
    #3
  4. barcaroller

    Clem Clarke Guest

    Fast and Safe C Strings: User friendly C macros to Declare and useC Strings.

    Some 20 years ago, it became clear that C strings were not as safe, nor
    as fast, as strings in PL/I, Assembler or Pascal.

    The primary reasons are that one needs to find the current length of a
    string before or during a copy process - this is very time consuming.

    Secondly, there is no way of determining the maximum length of a string,
    and therefore when copying to a string, it is easy to over-write
    adjacent storage with often disastrous consequences, including the
    deliberate introduction of viruses.


    Decades have passed and the C string problem continues. Buffer
    over-runs are just part of the story, and the bugs that can be
    introduced - the safety problem is still with us all and it has come
    back to bite all of us on the lower part of our anatomy, over and over
    again.

    I have spent some years studying this problem and have developed some
    User friendly C macros that solve the problem.

    These solutions do enhance the speed and safety aspects of all "C"
    programs - these benefits of speed and safety can be passed on to your
    users.

    The main benefits are:

    * Increased speed (up to 20 times for some string handling)
    * More reliability (strings cannot overwrite adjacent storage)
    * Easier coding and debugging (consistent set of macros)
    * Easier external variables

    Here is a very short example:

    dcl (op,charvar,253," ",ext); // Variable 'op' is defined
    // as an External variable - Max length of 253 characters.
    dcl (symbolic,charfixed,8," ",ext); // Fixed length of 8

    cpylit(op, "This is a 30 character string ");
    cat(op,op); /* Concatenate variable op with it self. Now 60
    characters */

    cpy(symbolic,op); /* Truncates it to 8 characters */

    cpy(op,symbolic); /* Copy it back. */

    I invite you download the macros and code at
    http://members.ozemail.com.au/~oscarptyltd/fastsafe.html where a fuller
    discussion can be found.



    Clement Clarke



    ,-._|\ Clement V. Clarke - Author Jol, EASYPANEL, OSCAR, 370TO486
    / Oz \ Web: www.ozemail.com.au/~oscarptyltd
    \_,--.x/ 38 Kings Park Road, West Perth, AUSTRALIA, 6005.
    v Tel (61)-8-9324-1119, Mob 0401-054-155.
     
    Clem Clarke, Apr 13, 2007
    #4
  5. barcaroller

    Default User Guest

    Re: Fast and Safe C Strings: User friendly C macros to Declare and use C Strings.

    Clem Clarke wrote:


    This clown did exactly the same thing on comp.lang.c, posted his crap
    in the middle of an existing thread.

    Once, maybe a mistake. Twice, well it's plonking time.




    Brian
     
    Default User, Apr 13, 2007
    #5
    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. Replies:
    4
    Views:
    441
  2. Josh Mcfarlane
    Replies:
    44
    Views:
    1,150
    Alf P. Steinbach
    Dec 16, 2005
  3. More effective C++

    , Jun 15, 2006, in forum: C++
    Replies:
    15
    Views:
    702
    Gernot Robert Bauer
    Jun 17, 2006
  4. Replies:
    3
    Views:
    318
  5. Boni Satani
    Replies:
    0
    Views:
    188
    Boni Satani
    Jan 9, 2014
Loading...

Share This Page