Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #553

Re: Array of Functions in C?

From Harry Potter <rose.joseph12@yahoo.com>
Newsgroups comp.os.msdos.programmer
Subject Re: Array of Functions in C?
Date 2012-05-04 06:13 -0700
Organization http://groups.google.com
Message-ID <14401593.1114.1336137198590.JavaMail.geo-discussion-forums@vbki8> (permalink)
References <22294500.461.1336054343786.JavaMail.geo-discussion-forums@vbep19> <jnvte1$k46$1@speranza.aioe.org>

Show all headers | View raw


I want to define the array as static (not the keyword but the scope, even though the keyword is used) at compile time rather than using mallc() to allocate them.  The individual functions are defined elsewhere and declared in a peviously-#included header.  I want to call the function via subscript, i.e.:

    c=(*foo) [2] (var);

I figure it would be faster and more efficient to do this instead of using switch() to delegate a call to a specific function based on a zero-indexed value.  If you need more clarifiication, I can reveal the bugged code either later today or starting on Monday.  Thank you for listening.  :)
--
Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Array of Functions in C? Harry Potter <rose.joseph12@yahoo.com> - 2012-05-03 07:12 -0700
  Re: Array of Functions in C? pete@nospam.demon.co.uk - 2012-05-03 18:26 +0000
  Re: Array of Functions in C? "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-05-04 02:37 -0400
    Re: Array of Functions in C? Harry Potter <rose.joseph12@yahoo.com> - 2012-05-04 06:13 -0700

csiph-web