overloaded function.????

a little help here. the error says there's an overloaded function but not sure what it means.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  #include <iostream>
#include <string>

using namespace std;

int main()
{

int num1;
int num2;
int num3;
string name;

cout<< "enter number"<<endl;
cin>>num1;
cout<< "enter number that is smaller than the first number you enter"<<endl;
cin>>num2;
cout<< "enter name"<< endl;
cin>>name;



    if(num1>0 && num2<num1)
    {
        num3=num1-num2;
        cout<<"A hungry group of "<<num1<<" are entering a hotdog eating contest. to win one million dollars. "<<endl;
        cout<<" the group was led by it's fattest member "<<name<<endl;
        cout<<endl;
        cout<< "After eating thirty hotdogs "<<num2<<" of your group members vomited and were disquilified."<<endl;
        cout<<"leaving only "<<num3<<" to continue on with the contest"<<endl;
        cout<<endl;
        cout<<"within thirty minutes your group manages to win the hotdog eating contest and win one million dollars"<<end;
    }
    else
        cout<<"you enter an invalid input"<<endl;



    return 0;
}
NVM i just miss the "l" in ends hahah my bad
Hi,

What was the error exactly?

You should always post errors directly from the compiler - it gives line numbers and other info handy to us, and is not subject to your interpretation :+) Just mentioning this because we have had these problems in the past :+)

I compiled it with cpp.sh the gear icon top right of the code. Line 32 has end not endl

It's not recommended to use std::endl anyway: it flushes the buffer every time and could be inefficient. Just use "\n" instead:

std::cout << " the group was led by it's fattest member " << name << "\n";

or

std::cout << "you enter an invalid input\n";

using namespace std; is not recommended either, that's why I have std:: before each std thing. Google to see why :+)

Cheers
Topic archived. No new replies allowed.