allora, programmo da 2 anni con c++, e non ho mai fatto uso di overload di funzioni [ però di operatori si :P ]
ora, ho questa domanda...
le funzioni :
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination )
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL )
mi vanno in conflitto, o meglio, vc++ express mi dice che
apply_surface( 0, 0, background, screen );
è una chiamata ambigua alle 2 funzioni, questo il problema dato
Codice:
1>------ Build started: Project: Dominium SDL, Configuration: Release Win32 ------
1>Compiling...
1>main.cpp
1>.\main.cpp(89) : error C2668: 'apply_surface' : ambiguous call to overloaded function
1> .\main.cpp(46): could be 'void apply_surface(int,int,SDL_Surface *,SDL_Surface *,SDL_Rect *)'
1> .\main.cpp(36): or 'void apply_surface(int,int,SDL_Surface *,SDL_Surface *)'
1> while trying to match the argument list '(int, int, SDL_Surface *, SDL_Surface *)'
1>.\main.cpp(90) : error C2668: 'apply_surface' : ambiguous call to overloaded function
1> .\main.cpp(46): could be 'void apply_surface(int,int,SDL_Surface *,SDL_Surface *,SDL_Rect *)'
1> .\main.cpp(36): or 'void apply_surface(int,int,SDL_Surface *,SDL_Surface *)'
1> while trying to match the argument list '(int, int, SDL_Surface *, SDL_Surface *)'
1>Build log was saved at "file://c:\Documents and Settings\Administrator\Documenti\Visual Studio 2005\Projects\Dominium SDL\Dominium SDL\Release\BuildLog.htm"
1>Dominium SDL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
perchè dà questo problema?
non dovrebbe riconoscere in automatico quale dei 2 usare, in base al numero di parametri passati?
grazie in anticipo delle risposte ^^
edit : risolto...
è la stessa identica cosa, ecco perchè