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

Aug 26, 2013 at 10:31am

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

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?

Thanks,

Ivan

#260005
Aug 26, 2013 at 10:56am

Hi,

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

#260007

You must be logged in to reply to this topic.