#include <iostream.h> int add(int a,int b, int c=3); main() { int x,y,z; x=add(10,20,30); y=add(40,50) z=add(10) cout<<x<<endl<<y<<"\n"<<z; } Tells me theres something wrong with the header file iostream.h . I dont understand it?
What is the exact error message? Try #include <iostream> Are you trying to compile with gcc instead of g++?
here's the program with rectified errors. its running in tcc successfully. contact me for further support. #include <iostream.h> int add(int a,int b, int c=3) { return a+b+c;} void main() { int x,y,z; const int k=10; x=add(10,20,30); y=add(40,50); z=add(10,k); cout<<x<<endl<<y<<"\n"<<z; } Code (markup): for dev c++ : #include<iostream.h> #include<conio.h> int add(int a,int b, int c=3) { return a+b+c;} int main() { int x,y,z; const int k=10; x=add(10,20,30); y=add(40,50); z=add(10,k); cout<<x<<endl<<y<<"\n"<<z; getch(); return 0; } Code (markup):