Number of outlets set by the argument: C-coding.

    Aug 26 2013 | 5:31 pm
    Hello C-programmers,
    I am making some objects in C and was wondering how does one go about creating an object with number of outlets set by the objects' argument. The example of such object is [gate] where the argument sets the number of outlets. Since the pointers to the outlets are in data structure part of the code it seems like the maximum number of outlets has to be hardcoded. Is this the case? I noticed that [gate] can have up to 100 outlets, does this mean that there are 100 pointers created in the typedef struct and then in the new instance routine you create actual outlets up to that number?

    • Aug 26 2013 | 5:56 pm
      for example, by creating an array of voids, for which you would allocate memory in the instance creation routine and free it in the instance destruction routine. Then you can use this array to store and refer to your outlets.
      BTW, you're on the wrong forum...
      HTH, Ádám