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"
usingnamespace 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.