I can't run this program , need an urgent help

i want to run this code…

//class name//
class adding
        int add(int a,int b);
        int _a;
        int _b;

//function definition//
int adding::add(int a,int b)
  return _a;

//main arduino file// 
int x=2,y=3,z;
void setup() 
void loop() 
   z= add(x,y);

sketch_mar12a.ino (376 Bytes)

Too urgent to read the posting guidelines, eh?

How to use this forum

Please use code tags.

Read this before posting a programming question

Please edit your post, select the code, and put it between [code][/code] tags.

You can do that by hitting the “Code” button above the posting area (It looks like a scroll with < > inside it).

i want to run this code.......

Well, run it!

adding is a class. You need to make an instance of that class.

For example, Fido is an instance of the class "dog".

You can feed Fido, you can't feed dog.

how Can i make an instance of that class??? i'm trying to use class name and function definition only to add two variables , and the function will return. how can i do that using my uploaded code ...... please help if u understand what i am trying to do..... thanks

Hint: You've made a few instances of the class "int" - riff off that.

For example:

    adding addingInstance; // object type, followed by variable name
    z= addingInstance.add(x,y); // using a method of an object

Note: study this well in the textbook. It'll be in the exam.