Reputation: 3077
I've got a variable:
int Result = 42 % 84;
However its returning null on NSLog?
Upvotes: 0
Views: 355
Reputation: 12797
How does it return null in NSLog? Did you write "%@"?
Reputation: 16337
int r=42%84; NSLog(@"%d", r);
The above code logs 42 for me.
Upvotes: 2
Reputation: 523304
To NSLog an integer, use %d.
%d
int result = 42 % 84; NSLog(@"%d", result);
Upvotes: 6