开发者

Why can't I make my parameter like this?

开发者 https://www.devze.com 2022-12-29 13:44 出处:网络
- (void)setPrope开发者_运维问答rtyValue:(const *void)inValue forID:(UInt32)propertyID { } The compiler doesn\'t like the const *void, for some reason. When I have that, it says:
- (void)setPrope开发者_运维问答rtyValue:(const *void)inValue forID:(UInt32)propertyID {

}

The compiler doesn't like the const *void, for some reason. When I have that, it says:

error: expected ')' before 'void'

When I make the parameter like (UInt32)foo there is no problem. Does const *void only work in functions?

I need a parameter which can be a "pointer to anything" like UInt32, Float64, etc.


Do you mean const void *?


Use

(const void*)

instead. (const * void) doesn't work in C++ / C either.

0

精彩评论

暂无评论...
验证码 换一张
取 消