c++ - what's the type of 'struct random_data* buf'? -
i'd have instance variable of "struct random_data*" used in
int random_r(struct random_data *buf, int32_t *result);
i've tried declaring as
"struct random_data* instancebuf;"
"random_data* instancebuf;"
but compiler doesn't of it.
how should declare variable?
-edit
ah,, api linux, , i'm on mac(bsd) :(
oh wait, linux only? http://www.gnu.org/s/libc/manual/html_node/bsd-random.html
probably:
struct random_data buff; int x = random_r (&buff, ...);
is easiest solution. you'll have make sure that structure has been defined.
and, if buffer required long lived (like seed), make sure it's defined somewhere large scope (global or class-level, example).
Comments
Post a Comment