views:

34

answers:

2

So what I want is to create 3 functions with same names but taking difrent arguments (one will take 2 and others one lats say System::String). (I will compile tham into .net library from visual-C++, create a c# project, connect my lib to it and want to be able to see in my library one function name which would have 3 overloads.)

How to do such thing in VS C++ 2010

+1  A: 

Declare three functions with the same name and different parameters.

SLaks
+1  A: 
ref class SampleClass
{
public:
    SampleClass(){}
    void Set(int value){}
    void Set(String^ value){}
    void Set(int value1, String^ value2){}
    ...
};

Build this as .NET Class library, and add reference to it in C# client project.

Alex Farber
And if i'd had 2 sets with 1 string as argument, how could i comment tham so that i could see the difference in c#?
Blender
It is impossible. Overloaded functions must have different sets of arguments.
Alex Farber