I am just learning C and I have a little knowledge of Objective-C due to dabbling in iOS development, however, in Objective-C I was using NSLog(@"%i", x);
to print the variable x to the console however I have been reading a few C tutorials and they are saying to use %d
instead of %i
.
printf("%d", x);
and printf("%i", x);
both print x to the console correctly.
These both seem to get me to the same place so I am asking the experienced developers which is preferred? Is one more semantically correct or is right?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…