“struct random_data* buf”的类型是什么?
我想要一个“struct random_data*”的实例变量,它在
int random_r(struct random_data *buf, int32_t *result);
我尝试声明为
“struct random_data* instanceBuf;”
“random_data*instanceBuf;”
但编译器不喜欢其中任何一个。
我应该如何声明变量?
-编辑
啊,,API是针对linux的,我在mac(bsd)上:(
哦等等,真的只有linux吗? http://www.gnu.org/s/libc/manual /html_node/BSD-Random.html
I'd like to have an instance variable of "struct random_data*" which are 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 like any of it.
How should I declare the variable?
-Edit
ah,, the api is for linux, and i'm on mac(bsd) :(
Oh wait, is it really linux only?
http://www.gnu.org/s/libc/manual/html_node/BSD-Random.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能:
是最简单的解决方案。但您必须确保已定义该结构。
而且,如果缓冲区需要长期存在(如种子),请确保将其定义在具有较大范围(例如全局或类级别)的位置。
Probably:
is the easiest solution. But you'll have to make sure that that structure has been defined.
And, if the buffer is required to be long lived (like a seed), make sure it's defined somewhere with a large scope (global or class-level, for example).