News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Default args for C++ functions

Started by gfalen, April 13, 2005, 10:01:24 PM

Previous topic - Next topic

gfalen

I'm trying to give default values to args using vctoolkit.  Help.......


ATOM _initclass(WNDPROC proc, LPCTSTR clas=0, LPCTSTR mnu=0)
{
}

cl.exe /c /MD /nologo /EHs /G7 /GA /GF /Ox /Ze demo.c
app32.h(23) : error C2143: syntax error : missing ')' before '='
app32.h(23) : error C2072: '_initclass' : initialization of a function
app32.h(23) : error C2059: syntax error : ')'
app32.h(24) : error C2143: syntax error : missing ';' before '{'
app32.h(24) : error C2449: found '{' at file scope (missing function header?)
app32.h(36) : error C2059: syntax error : '}'

GregL

Quotecl.exe /c /MD /nologo /EHs /G7 /GA /GF /Ox /Ze demo.c

C++ allows default argument values, C does not. Your program is .c vs .cpp and VC treats it accordingly.

gfalen