We help IT Professionals succeed at work.
Get Started

Help with C++ look up tables.

bail3yz
bail3yz asked
on
604 Views
Last Modified: 2013-12-14
Hi,

I am trying to learn how to use lookup tables as I am making a program that does some very time consuming math and I figure I could just put all the info into a look up table and use it that way..

I found some examples, but I do not fully understand it.

I found a poker example where it uses a look up table to determine the rank of a 7 card poker hand

however it only shows how it used the look up table, it didnt show how it made it..

one question I did have tho was

int HR[32487834];

^ this is the array the data is stored in.. how the coder determine the size it needed?

Lastly, if someone could write a small example on how to make a lookup table for a simple multiplication table that would be great!

Something like this
   1   2   3   4   5   6   7   8   9
1 1   2   3   4   5   6   7   8   9
2 2   4   6   8  10 12 14 16 18
3 3   6   9   12 etc
4
5
6
7
8
9

Comment
Watch Question
Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 3 Answers and 5 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE