array of pointers to void

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

array of pointers to void

Nicolau Werneck

Hello. I'm writing a  jack program, and in the process function,  I want to use
the void *arg in the process function to pass an array of pointers to void, and
then cast each of the pointers to the proper type.

Has anybody done something like this? I'm trying but the compiler keeps calling
me names!...

I tought void** was something pretty easy to use... :(

What's the best way to pass many paramets to the process function? :/


--
Nicolau Werneck <[hidden email]>         9F99 25AB E47E 8724 2F71
http://cefala.org/~nwerneck                   EA40 DC23 42CE 6B76 B07F
"After silence, that which comes nearest to expressing the inexpressible is music."
-- Aldous Huxley


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: array of pointers to void

Erik de Castro Lopo-10
Nicolau Leal Werneck wrote:

> What's the best way to pass many paramets to the process function? :/

Put everything you want to pass in a struct and then pass that.

Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"UML is a productivity tool with a negative coefficient."
-- Peter Miller

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: array of pointers to void

Erik de Castro Lopo-10
Erik de Castro Lopo wrote:

> Nicolau Leal Werneck wrote:
>
> > What's the best way to pass many paramets to the process function? :/
>
> Put everything you want to pass in a struct and then pass that.

That was a little quick.

To be more explicit, pass a pointer to the struct, not the struct
itself.

Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"life is too long to know C++ well" -- Erik Naggum

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: array of pointers to void

Nicolau Werneck
In reply to this post by Erik de Castro Lopo-10

For the record: the void** kludge did work.  The problem was that I was storing
the value  of a  pointer variable, instead  of its  address.  Since it  was not
initialized yet, the value used by the process was invalid!... Silly me! :)

On 030707, 11:49, Erik de Castro Lopo wrote:

> Nicolau Leal Werneck wrote:
>
> > What's the best way to pass many paramets to the process function? :/
>
> Put everything you want to pass in a struct and then pass that.
>
> Erik
> --
> -----------------------------------------------------------------
> Erik de Castro Lopo
> -----------------------------------------------------------------
> "UML is a productivity tool with a negative coefficient."
> -- Peter Miller
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Jackit-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jackit-devel
--
Nicolau Werneck <[hidden email]>         9F99 25AB E47E 8724 2F71
http://cefala.org/~nwerneck                   EA40 DC23 42CE 6B76 B07F
"You shall know the truth, and the truth shall make you mad."
-- Aldous Huxley


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment