Looks like you don't quite understand how to use a class.
A class is a new kind of object. Like an int, or a double, or a char. If you want to use one, first you create an instance of one, then you can use it.
This code does not work:
x = 7; // no such object named x
but this code does work
1 2
|
int x;
x = 7; // x has been created we can use it.
|
In the same way, you must create an instance of the class first, and
then you can use that instance
1.
You're not using C++; you're using some kind of Microsoft language, I'm guessing, but the syntax you're looking for is probably something like:
1 2
|
Class1 anInstanceOfTheClass; // Now we have created an instance of type Class1
anInstanceOfTheClass.add(6,2); // Use the member function add in the object we created
|
-------------
1) If a class definition contains static methods, you can use those without creating an instance of the class. However, given that you are unsure of how to use classes, best to start with the basics.