473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Structure/Storage question

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
Nov 14 '05 #1
6 1382
On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <ex****@signuts.net>
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/~a...FAQ-acllc.html
Nov 14 '05 #2
Jack Klein <ja*******@spamcop.net> scribbled the following:
On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <ex****@signuts.net>
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 (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"C++. C++ run. Run, ++, run."
- JIPsoft
Nov 14 '05 #3
Joona I Palaste wrote:
Jack Klein <ja*******@spamcop.net> 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.
Nov 14 '05 #4
On 4 Jan 2004 19:19:32 GMT, Joona I Palaste <pa*****@cc.helsinki.fi>
wrote in comp.lang.c:
Jack Klein <ja*******@spamcop.net> scribbled the following:
On Sun, 04 Jan 2004 13:51:11 -0500, Sig Lange <ex****@signuts.net>
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/~a...FAQ-acllc.html
Nov 14 '05 #5
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

Nov 14 '05 #6
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 : bi****@eton.powernet.co.uk
"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
Nov 14 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sean W. Quinn | last post by:
Hey folks, I have a question regarding file handling, and the preservation of class structure. I have a class (and I will post snippets of code later in the post) with both primitive data...
21
by: simon | last post by:
From my previous post... If I have a structure, struct sFileData { char*sSomeString1; char*sSomeString2; int iSomeNum1; int iSomeNum2;
1
by: Jeff | last post by:
Dear all, I was reading the ISO/IEC 9899 , and see the following thing: 6.7.1 10 . An implementation may allocate any addressable storage unit large enough to hold a bit- field. If enough...
10
by: Duncan M Gunn | last post by:
Hi, I need to store the following matrix of values: T U V A 2 1 1 B 2 - - C - - 2 Where (-) is an empty cell.
6
by: James | last post by:
I am using vb.net and need to keep in memory a large data structure, so I am looking for the best option. And after several test I am pretty confused. So I will be grateful if anyone can help me. ...
8
by: SP | last post by:
The following code crashes after I add the two nested FOR loops at the end, I am starting to learn about pointers and would like to understand what I'm doing wrong. I think the problem is the way...
11
by: aaragon | last post by:
Hi everyone. I'm trying to write a class with policy based design (Alexandrescu's Modern C++ Design). I'm not a programmer but an engineer so this is kind of hard for me. Through the use of...
17
by: jb.simon | last post by:
Recently I was pinged in a code review about my use of the initialization method AStruct myStruct = { 0 } ; Which initializes all elements of the myStruct to 0. I was questioned on it because...
10
by: Scott Townsend | last post by:
So I need to talk to a devices that expects all of the bits and bytes I sent it to be in specific places (not yet 100% defined). I wanted to create a structure/class with all of the data in it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.