hello guys,
i was just working some problem on function overloading topic, i wrote a simple program to test the topic, but i got some errors which i couldn't able to recover it, can u please tell me what the error is... here is the program and the error message
and the error is as followCode:#include<iostream> void printdat(int, int, int, char = '\'); using namespace::std; int main() { int mm,dd,yy; std::cout<<"Enter the date"<<endl; std::cin>>dd>>mm>>yy; printdat(dd,mm,yy,'.'); printdat(dd,mm,yy); return 0; } void printdat(int dd, int mm, int yy, char a) { std::cout<<dd<<a<<mm<<a<<yy<<std::endl; }
any help will be appreciatedCode:1.cpp:4:37: missing terminating ' character 1.cpp:4:37: warning: multi-character character constant 1.cpp:5: parse error before `using' 1.cpp:15: `dd' was not declared in this scope 1.cpp:15: `mm' was not declared in this scope 1.cpp:15: `yy' was not declared in this scope 1.cpp:15: ISO C++ forbids declaration of `printdat' with no type 1.cpp:15: `int printdat' redeclared as different kind of symbol 1.cpp:14: previous declaration of `void printdat(...)' 1.cpp:15: initializer list being treated as compound expression 1.cpp:16: ISO C++ forbids declaration of `getchar' with no type 1.cpp:17: parse error before `return' 1.cpp: In function `void printdat(int, int, int, char)': 1.cpp:21: `void printdat(int, int, int, char)' redeclared as different kind of symbol 1.cpp:15: previous declaration of `int printdat' 1.cpp:15: previous non-function declaration `int printdat' 1.cpp:21: conflicts with function declaration `void printdat(int, int, int, char)'



LinkBack URL
About LinkBacks


