home bbs files messages ]

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,705 of 243,242   
   Michael Sanders to Kaz Kylheku   
   Re: function pointer question   
   02 Jan 26 19:35:51   
   
   From: porkchop@invalid.foo   
      
   On Fri, 2 Jan 2026 17:48:16 -0000 (UTC), Kaz Kylheku wrote:   
      
   > On 2026-01-02, Michael Sanders  wrote:   
   >> B: because every function must have a return type   
   >>    *including function pointers*?   
   >   
   > What it is you think type is, in the context of C?   
   >   
   > Does type survive into run-time?   
   >   
   > If a function pointer is missing type information about return type, and   
   > that function pointer is needed for expressing a function call, where   
   > does the compiler get the type from?   
      
   Its void that's throwing me Kaz. I'm not sure what to think when   
   it comes to void pointers.   
      
   A void pointer (the pointer itself) is not of the type   
   it points to no? Its typeless & unknown at compile time   
      
   A 'normal' pointer in C is a variable that stores the address   
   of another variable. And *is of the type it points to*...   
      
   char str[] = "learning publicly is a humbling experience.";   
   char *ptr = str;   
      
   Then void enters stage left...   
      
   void *genericPointer;   
      
   It can point to an integer, a character, a structure, or any other type.   
      
   void *genericPointer = &intValue;   
   void *genericPointer = str[];   
      
   And it seems to survive a lack of type at compile time.   
   Man I'm confused on this. I mean I get void is flexible,   
   but 'void' is not void in any sense... its like a mask in some   
   way (I'm groping for a definition) I need to study void more.   
      
   --   
   :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