Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 242,838 of 243,242    |
|    Michael Sanders to James Kuyper    |
|    Re: function pointer question    |
|    06 Jan 26 16:49:45    |
   
   From: porkchop@invalid.foo   
      
   On Tue, 6 Jan 2026 10:58:36 -0500, James Kuyper wrote:   
      
   > I'm curious - in what context did you encounter that code? As written,   
   > it's an expression, and foo would have to be a pointer to an object,   
   > which would be a change of subject from the previous messages in this   
   > thread.   
      
   I just just managed to get myself confused because there seems to be   
   more than one way to use void.   
      
   > However,   
   >   
   > (void) *foo;   
   >   
   > would be a declaration equivalent to   
   >   
   > void *foo;   
   >   
   > which is a pointer to void, which would fit the context of our previous   
   > discussion. Could that be what you're actually asking about?   
      
   Shoot, its just that I lack at the moment the C-specific vocabulary to   
   describe what I'm wondering about James. Frustrating trust me =) Mainly   
   its that void seems to be used across multiple contexts (in differing ways).   
   Keith was saying void has special properties...   
      
   Nevertheless, I bumbled through it. Here are the functions:   
      
    void mastermind(int hst_len, const char *gme_msg);   
    void moo(int hst_len, const char *gme_msg);   
    void bagels(int hst_len, const char *gme_msg);   
      
   Here's the latest way I'm using them...   
      
    static void (*mode[])(int, const char *) = { mastermind, moo, bagels };   
    void (*render)(int, const char *) = mode[app.idx];   
      
   Welp, back to studying for me.   
      
   --   
   :wq   
   Mike Sanders   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca