/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
void add (int x,int y){
std::cout << "In func add(int,int) \nSum = " <<x+y<<std::endl;
}
void add (double x,double y){
std::cout << "In func add(double ,double) \nSum = " <<x+y<<std::endl;
}
int main()
{
cout<<"Hello World";
add(1,2.3);
return 0;
}
/***************************
main.cpp: In function ‘int main()’:
main.cpp:25:14: error: call of overloaded ‘add(int, double)’ is ambiguous
add(1,2.3);
^
main.cpp:13:6: note: candidate: void add(int, int)
void add (int x,int y){
^~~
main.cpp:18:6: note: candidate: void add(double, double)
void add (double x,double y){
***************************/