07-24-2023, 06:34 AM
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_?
`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_?