vimarsana.com

மூன்று பிழைகள் மறைத்து News Today : Breaking News, Live Updates & Top Stories | Vimarsana

Chris s Wiki :: blog/programming/PrintfAndArgumentPassing

December 28, 2020 The variable arguments in printf formatting means that it is easy to get type mismatches. The practical results vary considerably: printf(“0x%08lx”, p); // Printing a pointer as an int – truncation or worse on 64-bit printf(“%d, %f”, f, i); // Swapping float and int – could print nonsense, or might actually work (!) printf(“%s %d”, i, s); // Swapping the order of string and int – will probably crash [.] (aside: understanding why #2 often prints the desired result is a good ABI puzzle) I had to think about this for a bit, and then I realized why and how it can work (and why similar integer versus float argument

© 2025 Vimarsana

vimarsana © 2020. All Rights Reserved.