View Single Post
Old 07-14-2012, 09:40 PM   #1
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Question nooby c++ to c question. dereferencing allocated memory variable

Hi.

If I have a [blackbox] method in c++ (which I'm porting to c)
First am I setting up the right variables to put in it.
Code:
short audioBuffer[someLength];
float *signal;
float frequency, sr;
int vector_size;
something? delayed_signal;

float highpass(float* sig, float freq, float *del, int vecsize, float sr)
{

blah

}
also how do i reference each bit, I can get the obvious stuff but I'm not sure exactly what the second pointers expecting. the first one wants a location in the audio buffer I expect, I can provide that.

( A POINTER TO A FLOAT, a float, A & of a * ???, an int, a float)

I'm a bit foggy on the pointers though. yes I am off have RTfriendlyM but any help is always appreciated EDIT: Because I still don't get it

Thanks. I understand they represent an address rather than the value itself and I can get the first one right I think, is the second one a ** or a & or what?
The transition to c is a slow one.

also, are there any caveats I should watch for during the conversion to c?
(err just the big lumps)

thanks a lot

Last edited by twobob; 07-14-2012 at 09:50 PM. Reason: added some variable instancing, and extra notes
twobob is offline   Reply With Quote