unexpected token error when defining a function

hello, im a beginner , i made a header file in which i declared a function op2().header file:
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef M_OPS_H
#define	M_OPS_H

#ifdef	__cplusplus
extern "C" {
#endif
    void op2();
#ifdef	__cplusplus
}
#endif

#endif	/* M_OPS_H */ 


then i made a .cpp implementation file when i defined the function op2()
to take 2 numbers as input then calculates and print sum.but its giving an error
: unexpected token:{.this is my .cpp file
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "m_ops.h"
using namespace std;

int main() {
    op2() {
        int a, b;
        cout<<"Enter a:";
        cin>>a;
        cout<<"Enter b:";
        cin b;
        cout<<"sum = "<<a+b<<endl;
    }
}

and this is giving following error:
mcalc.cpp: In function 'int main()':
mcalc.cpp:5:11: error: expected ';' before '{' token
op2() {
^
pls help me and also suggest some other ways to perform this task as i want to make a calculator
thanks.
Topic archived. No new replies allowed.