Hi,
In assembly language you can use a lookup table to call functions.
1. Lookup function address in table
2. Call the function
Like:
CALL FUNCTION[INDEX]
FUNCTION DD FUNC1, FUNC2, FUNC3
FUNC1:
FUNC2:
FUNC3:
RET
How can I do this in C++ I would like it to be reasonably fast also?
The way I am doing it now is with a big switch statement. The switch
uses the index number for lookup. This seems like a bad way to do
what I'd would like. The preferred way would be with the lookup tables.
If anyone could help I would appreciate it.
Thanks
John Collyer
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
In assembly language you can use a lookup table to call functions.
1. Lookup function address in table
2. Call the function
Like:
CALL FUNCTION[INDEX]
FUNCTION DD FUNC1, FUNC2, FUNC3
FUNC1:
FUNC2:
FUNC3:
RET
How can I do this in C++ I would like it to be reasonably fast also?
The way I am doing it now is with a big switch statement. The switch
uses the index number for lookup. This seems like a bad way to do
what I'd would like. The preferred way would be with the lookup tables.
If anyone could help I would appreciate it.
Thanks
John Collyer
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Comment