Skip to main content
GameDev.net gamedev.net
🔒 Locked

error C2665. No overloaded function?

Started by squicklid Apr 2, 2004 at 11:58 AM 1 replies 950+ views
Original Post
squicklid
squicklid
I have the three function prototypes: void drawText(char * str, int x, int y, COLORREF crcolor, int len); void drawText(GString gstr, int x, int y, COLORREF crcolor); void drawText(int num, int x, int y, COLORREF crcolor); and corresponding functions. However, when I try to use the last one like so: int num=5; drawText(num, x+270, y+30, TXT_STATIC, 2); it doesn''t work, giving me the error: error C2665: ''drawText'' : none of the 3 overloads can convert parameter 1 from type ''int'' which confuses me a lot, because i do have an overload. The other two work though. Any help on this?
Agony
Agony
You''re passing a length of 2 to the function, which makes it only consider the first drawText, the one with a char*. Get rid of the last parameter in your function call.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas nly, and not for things themselves." - John Locke o
squicklid
squicklid
Well that was awefully retarded of me..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.