about functions names and labels names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PuzzleC
    New Member
    • Nov 2007
    • 9

    about functions names and labels names

    I have a two questions then like.

    The question is as follows

    How i be able so as: put into the variable of char** type :) the functions names?

    detailed (as a rough guide)...

    Code:
    char *function_names[] = { "function_A()", "function_B()", "function_C()" };
    so as to...
    Code:
    i=0;
    while( i<3 )
     {
     /*call*/ function_names[ i ];
     ++i;
     }

    and

    How i put into the variable of (whats type?) label name?
    detailed (as a rough guide)...
    Code:
    char *labels_names[] = { "label_A()", "label_B()", "label_C()" };
    so as to...
    Code:
    ...
     goto labels_names[ 0 ];
    ...
    request not laugh
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    Storing the name of a function as text doesn't allow you to call that function, but you can use function pointers to do what you want. Try poking around here http://www.newty.de/fpt/index.html l

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      PuzzleC-

      Please check your Private Messages, accessible through the PM's link in the top right corner of the page.

      Comment

      Working...