#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// insert code here...
NSLog(@"Hello, World!");
float a = 12.3454323;
NSLog(@"%d", a);
NSLog(@"%g", a);
[pool drain];
return 0;
}
hi, i made very simple program to explain my question: output of this program is:
1st line: some random number (394883904, or 89374e-15 or ...) 2line: 12.3454323
so.. my question: what is @"%d" and what is @"%g").. because, IF a is INTEGER (int a = 156)
then @"%d" gives 156 BUT @"%g" gives 8.32059e-315 or similar :)
i'm doing bluetooth transfer of these values, but this is my problem to send positions what are in integer and then to show it, it is working but i have to check what is what, so, is there any lesson about @"%d" and similar staff? when use @"%d" and when use @"%g".. and are there any other @"%something"? thank you
edit: of course, zero line is hello world! :)
%i
is integer and%d
is double or float – Rna