The information in this article applies to:
SYMPTOMSCompiling a C++ source file which uses a forward reference to a struct in a function prototype will cause the compiler to generate the following error: The sample code shown below can be used to illustrate this problem. Note: the error does not occur if the same file is compiled as a C source file. CAUSEThis is by design. In C++, a tag not previously seen is entered in the current scope. In the sample code, the ForwardRef appearing in the parameter list is a different struct than the one defined afterwards. RESOLUTIONTo resolve this problem, move the declaration of the struct so that it is located before the function prototype. Sample Code
Additional query words: 8.00 8.00c 9.00
Keywords : kbCompiler |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |