Function Prototype With Default Parameters

  • Thread starter Wanderley Caloni Jr
  • Start date
W

Wanderley Caloni Jr

Hi,

I get a problem when ported my code from VS 2002 to VS 2003.
Aparently, a typedef of a function with default parameters doesn't work
anymore. I used to compile this code in VS 2002.

Anyone already has this problem?


Code:
typedef int (*GIMP_SCUAIMPORTOBJECTS)
(CHAR szPath[MAX_PATH],
CHAR szServerName[100],
CHAR szSecServer[100],
DWORD modules = GIMP_MOD_ALL,
LPVOID reserved = NULL);

error C2383: 'GIMP_SCUAIMPORTOBJECTS' : default-arguments are not
allowed on this symbol.


Thanks by attention.

[]s
 
C

Carl Daniel [VC++ MVP]

Wanderley said:
Hi,

I get a problem when ported my code from VS 2002 to VS 2003.
Aparently, a typedef of a function with default parameters doesn't
work anymore. I used to compile this code in VS 2002.

That's correct. The C++ standard does not allow specification of default
parameters on a typedef -VC7 (and before) should not have accepted it.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top