Samuel
Samuel

Reputation: 11

How to implement/merge C# interface into a simple C++ program using Visual Studio Express 2013

I'm just a rookie in programming. Currently in my semester learning C++. So basically I've basic knowledge of C++. I'm using Visual Studio Express 2013 for my basic codings. I've got an assignment about getting orders, display them, count total price and print a receipt. This time lecturer asked us to try to use an interface, either .NET or C#. I've watched some videos on how to use C# to create interfaces but what has been going through my brain is how do i use my codes in C++ with the interfaces in C#?

Thanks a lot for any response !

Upvotes: 0

Views: 235

Answers (1)

Jan Turoň
Jan Turoň

Reputation: 32912

There is no interface in C++. You could code a class with pure virtual methods to achieve the same functionality:

C#

interface Foo {
  void Bar();
}

C++

class Foo {
public:
  virtual void Foo()=0;
}

Here is a wiki link for more info.

Upvotes: 1

Related Questions