KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q59891: li, lu, and ld Replace I, U, and D as Format Specifiers

Article: Q59891
Product(s): See article
Version(s): 2.00 2.01 2.50 2.51
Operating System(s): MS-DOS
Keyword(s): ENDUSER | s_quickasm s_c docsup | mspl13_c
Last Modified: 29-MAY-1990

When scanning long values with the scanf() function, use %li, %lu, and
%ld.

Since the format specifiers %I, %U, and %D are not part of the ANSI
standard, they will not be supported in compilers released after the C
Version 5.10 Optimizing Compiler.

You must follow the ANSI standard and use %l[x] for long values.

If you use %I, %U, or %D as a format specifier for a long value, the
scanf() function family will not return an indication of an error.
Instead the format specifier will be treated as its lowercase
counter part. For example:

   %I --> %i
   %U --> %u
   %D --> %d

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.