How to print int*
(int pointer) and unsigned int*
in log using NSLog
?
- (int) doSomethingWith:(unsigned int)Msg withWparam:(unsigned int*)wParam withParameter:(int *) lParam { NSLog(@"MSg:%d wParam:%u lParam:%u",Msg,wParam,lParam); //not working return 1; }
Warning: Format specifies type 'unsigned int' but the argument has type 'unsigned int *'
Use %d
for int
. And the parameters are pointers, so use *
to access the values pointed to.
NSLog(@"MSg:%d wParam:%u lParam:%d",Msg,*wParam,*lParam);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With