J
J
JustStone2019-02-22 11:34:01
C++ / C#
JustStone, 2019-02-22 11:34:01

How to fix error when overloading C# methods?

I am learning C# and there was a problem on the topic of method overloading, it gives an error that the function is already defined in this area, I look on the Internet for examples of other codes when overloading and there is no such error, maybe I have something with Visual Studio? Even the worker tried to copy someone else's code from the Internet when reloading, this error is still the same
5c6fb340c26ff666788254.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-02-22
@JustStone

The problem is that you have defined two local functions in a function, which you can't do.
Move the definition from the function block to the class, and everything will work like in the examples from the Internet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question