Microsoft KB Archive/85510

= CodeView Does Not Use Default Arguments for Functions =

Article ID: 85510

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft CodeView 4.0
 * Microsoft CodeView 4.01
 * Microsoft CodeView 4.01
 * Microsoft CodeView 4.1
 * Microsoft CodeView 4.0
 * Microsoft CodeView 4.01
 * Microsoft CodeView 4.1

-



This article was previously published under Q85510



SUMMARY
Microsoft CodeView versions 4.0 and later, which support debugging C++ programs, do not correctly evaluate functions that use default arguments. When an expression is used that requires CodeView to evaluate a function with a default argument, the following error message is displayed:

CXX0047: Error: argument list does not match a function



MORE INFORMATION
The sample code below contains a function that has a default argument. In the program, the function PrintOut can be called either with a void parameter list or with a character pointer. When the following command is executed from CodeView's command window ? PrintOut(&quot;This is a string constant&quot;) the function is called and &quot;This is a string constant&quot; is printed to the output screen. When the function PrintOut is called with no parameters, for example ? PrintOut the error CXX0047 is generated. This occurs only when using the &quot;?&quot; command in CodeView to force a function to be evaluated.

Default arguments are supported only in C++ programs.

Sample Code
/* Compile options needed: /Od /Zi


 * 1) include 

void PrintOut (char *String = &quot;This is a default argument.&quot;);

void main (void) {  PrintOut; PrintOut( &quot;This is not a default argument.&quot;); }

void PrintOut (char *String) {  cout << String << endl; }

Additional query words: kbinf 4.00 4.10

Keywords: kberrmsg kbbug kbdebug KB85510

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.