[Solved] C++ Multiple Static Functions With Same Name But Different Arguments [closed]


Well first of all, you’re passing a Color3 pointer into an overloaded function that takes two different references.

You have a range of options:

  • Don’t pass a pointer (you have Color3 color in main(), don’t pass &color, pass color)
  • De-reference the pointer to pass a reference (having a Color3* color in main(), pass *color not color)
  • Change the method or add one to accept a Color3 pointer. This is dumb and I don’t advise it. But you can!

Also I know it’s not a part of the question but it appears getRed, getGreen, and getBlue are methods that you should append () to.

2

solved C++ Multiple Static Functions With Same Name But Different Arguments [closed]