i am using devc++
and my code is
The errors encountered are.Code:#include<iostream> using namespace std; class complex { private : int a; int b; public : complexnum() { a = 0; b = 0; } void input() { cin >> a >> b; } void display() { cout << a << " + " << b <<"i"; } void add(complexnum x,complexnum y); void sub(complexnum x,complexnum y); } //implementation void complexnum :: add(complexnum x,complexnum y) { a = x.a + y.a; b = x.b + y.b; } void complexnum :: sub(complexnum x,complexnum y) { a = x.a - y.a; b = x.b - y.b; } //application int main() { complexnum c1,c2,c3; c1.input(); c2.input(); c3.add(c1,c2); c3.display(); c3.sub(c1,c2); c3.display(); }
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\C++_Programming\complex.c" -o
:1:19: iostream: No such file or directory
:3: error: parse error before "namespace"
:3: warning: data definition has no type or storage class
:5: error: parse error before "complex"
.........
why is it so?
please help......



LinkBack URL
About LinkBacks




Thanks, but I think you missed my point.