The information in this article applies to:
SYMPTOMSIf program contains a string literal that is incorrectly split over multiple lines the following error will occur: Several other errors may be caused by this also. This sample will also give errors C2065, C2121, C2143, and C2198 as a result of the newline errors. CAUSEThis is a common programming mistake. Special considerations must be taken to split a constant string over several lines. RESOLUTIONThe best method is to change the format string, as in the following example (this works because strings separated only by spaces, tabs, and/or newlines are concatenated as specified by the ANSI standard):
The older and less-preferred method is to use continuation lines by
typing a backslash followed by a carriage return at the end of a
line, as in the following example:
This is not as good as the previous example because the spaces at
the beginning of the continuation line become part of the string,
unlike the first example.
MORE INFORMATIONSample Code
Additional query words: 1.00 1.50 2.00 2.10 6.00 6.00a 6.00ax 7.00 8.00 8.00c 9.00 9.10
Keywords : kbCompiler |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |