Structure/Storage question

Discussion in 'C Programming' started by Sig Lange, Jan 4, 2004.

  1. Sig Lange

    Sig Lange Guest

    I need an efficient structure to store a counter and an IP address. I'm
    thinking a hash would be the fastest method but I'm not sure.

    Any comments questions would be much appreciated...

    Thank You,
    Sig
    Sig Lange, Jan 4, 2004
    #1
    1. Advertising

  2. Sig Lange

    Jack Klein Guest

    On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <>
    wrote in comp.lang.c:

    > I need an efficient structure to store a counter and an IP address. I'm
    > thinking a hash would be the fastest method but I'm not sure.
    >
    > Any comments questions would be much appreciated...
    >
    > Thank You,
    > Sig


    You need a hash to store a (one) counter and an (one) IP address?
    Seems like overkill to me. Also there doesn't seem to be anything C++
    specific in your question.

    You need to provide a better problem statement, and if a storage and
    retrieval algorithms are your primary concern, ask in an algorithm
    group such as news:comp.programming. After you have selected an
    appropriate algorithm, if you have difficulty implementing it in
    standard C++, post your problem code here and ask for help.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jan 4, 2004
    #2
    1. Advertising

  3. Jack Klein <> scribbled the following:
    > On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <>
    > wrote in comp.lang.c:
    >> I need an efficient structure to store a counter and an IP address. I'm
    >> thinking a hash would be the fastest method but I'm not sure.
    >>
    >> Any comments questions would be much appreciated...


    > You need a hash to store a (one) counter and an (one) IP address?
    > Seems like overkill to me. Also there doesn't seem to be anything C++
    > specific in your question.


    Where did you see anyone mention C++?

    > You need to provide a better problem statement, and if a storage and
    > retrieval algorithms are your primary concern, ask in an algorithm
    > group such as news:comp.programming. After you have selected an
    > appropriate algorithm, if you have difficulty implementing it in
    > standard C++, post your problem code here and ask for help.


    Where did you see anyone mention C++?

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "C++. C++ run. Run, ++, run."
    - JIPsoft
    Joona I Palaste, Jan 4, 2004
    #3
  4. Joona I Palaste wrote:

    > Jack Klein <> scribbled the following:
    >
    >>You need a hash to store a (one) counter and an (one) IP address?
    >>Seems like overkill to me. Also there doesn't seem to be anything C++
    >>specific in your question.

    >
    >
    > Where did you see anyone mention C++?


    He must have thought he was reading comp.lang.c++. Easy mistake to make
    if you read both that group and this one.

    >
    >
    >>You need to provide a better problem statement, and if a storage and
    >>retrieval algorithms are your primary concern, ask in an algorithm
    >>group such as news:comp.programming. After you have selected an
    >>appropriate algorithm, if you have difficulty implementing it in
    >>standard C++, post your problem code here and ask for help.


    Obviously the OP should ask standard C++ questions in comp.lang.c++, not
    here. But if one has a standard C question, this is the place.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
    Kevin Goodsell, Jan 4, 2004
    #4
  5. Sig Lange

    Jack Klein Guest

    On 4 Jan 2004 19:19:32 GMT, Joona I Palaste <>
    wrote in comp.lang.c:

    > Jack Klein <> scribbled the following:
    > > On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <>
    > > wrote in comp.lang.c:
    > >> I need an efficient structure to store a counter and an IP address. I'm
    > >> thinking a hash would be the fastest method but I'm not sure.
    > >>
    > >> Any comments questions would be much appreciated...

    >
    > > You need a hash to store a (one) counter and an (one) IP address?
    > > Seems like overkill to me. Also there doesn't seem to be anything C++
    > > specific in your question.

    >
    > Where did you see anyone mention C++?


    Bad hair day!

    >
    > > You need to provide a better problem statement, and if a storage and
    > > retrieval algorithms are your primary concern, ask in an algorithm
    > > group such as news:comp.programming. After you have selected an
    > > appropriate algorithm, if you have difficulty implementing it in
    > > standard C++, post your problem code here and ask for help.

    >
    > Where did you see anyone mention C++?


    I was momentarily insane, but I'm better now.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jan 4, 2004
    #5
  6. Jack Klein wrote:

    > After you have selected an
    > appropriate algorithm, if you have difficulty implementing it in
    > standard C++, post your problem code here and ask for help.


    No, please don't. Jack normally doesn't slip this way. If you have a C++
    problem, post to comp.lang.c++. "Here" is comp.lang.c, for which you
    should have a C problem.



    --
    Martin Ambuhl
    Martin Ambuhl, Jan 5, 2004
    #6
  7. Martin Ambuhl wrote:

    > Jack Klein wrote:
    >
    >> After you have selected an
    >> appropriate algorithm, if you have difficulty implementing it in
    >> standard C++, post your problem code here and ask for help.

    >
    > No, please don't. Jack normally doesn't slip this way. If you have a C++
    > problem, post to comp.lang.c++. "Here" is comp.lang.c, for which you
    > should have a C problem.


    Martin normally doesn't slip this way. :)

    Of course you /don't/ need a C problem in order to post in comp.lang.c. You
    might have an *answer* to a problem, or a correction or observation
    regarding someone else's answer, or you might just have an interesting
    snippet of C news, such as the release of another conforming C99
    implementation, a decent new book, a handy new library, or maybe just some
    C code that you happen to think is noteworthy for some reason.

    This is, after all, a *news*group.

    --
    Richard Heathfield :
    "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    K&R answers, C books, etc: http://users.powernet.co.uk/eton
    Richard Heathfield, Jan 5, 2004
    #7
    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. Spudgun via JavaKB.com

    Storage Structure

    Spudgun via JavaKB.com, Sep 13, 2005, in forum: Java
    Replies:
    3
    Views:
    390
    Roedy Green
    Sep 14, 2005
  2. Excluded_Middle

    Pointers to structure and array of structure.

    Excluded_Middle, Oct 24, 2004, in forum: C Programming
    Replies:
    4
    Views:
    750
    Martin Ambuhl
    Oct 26, 2004
  3. Leo Nunez
    Replies:
    3
    Views:
    1,212
    Neil Kurzman
    Feb 9, 2005
  4. sarathy
    Replies:
    2
    Views:
    660
    sarathy
    Jul 17, 2006
  5. Replies:
    2
    Views:
    603
Loading...

Share This Page