|
|||||||||||
Technical Support Support Resources
Product Information |
C166: sprintf and far StringsInformation in this article applies to:
QUESTIONIn C166, I'm using sprintf to get formatted data into a far array of characters. My question is: Is it valid to pass strings that exist in far memory to sprintf as shown here?
If yes, for which memory models (other than TINY) is it not valid? ANSWERYes. This is valid. In the C166, the following memory models, by default, assume that variables are of the indicated types.
In COMPACT and LARGE memory models, sprintf assumes that the buffer is in far memory (and a far pointer is needed). Since a far pointer can be converted into a huge pointer, HCOMPACT and HLARGE models will also work for your example (because far pointers can be converted into huge pointers). MEDIUM, SMALL, and TINY models will not work (unless you luck out and the far memory is in the same space as the near memory). MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.