Error: redundant redefinition of arguments

Hi all,
I'm making a library with functions that validate a user's input and returns it if it's valid. I'm encountering the same debugging errors, "Redundant redefinition of (function)" in my implementation file. My header file seems to be fine

Implementation:
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.....lines of code before this work. The bolded ones are where the errors are.

double input_prot (string prompt, string err, double upper){
    double input;
    cout<<prompt;
    cin>>input;
    if (cin.fail()){ //if it isn't even a double
     cout<<"invalid input'/n'";
        cin.clear() ;
        cin.ignore();
    }
    else if (input>upper){ //double but out of bounds 
        cout<<err<<endl ;
        cin.clear();
        cin.ignore();
    }
    else {
        return input;
    }
    return input;
}//closes function

long input_prot (string prompt, string err, long upper){
    long input;
    cout<<prompt;
    cin>>input;
    if (cin.fail()){ //if it isn't even a long
     cout<<"invalid input'/n'";
        cin.clear() ;
        cin.ignore();
    }
    else if (input>upper){ //long but out of bounds 
        cout<<err<<endl ;
        cin.clear();
        cin.ignore();
    }
    else {
        return input;
    }
    return input;
}//closes function
double input_prot (string prompt, string err, double lower){
    double input;
    cout<<prompt;
    cin>>input;
    if (cin.fail()){ //if it isn't even a double
     cout<<"invalid input'/n'";
        cin.clear() ;
        cin.ignore();
    }
    else if (lower >input){ //double but out of bounds 
        cout<<err<<endl ;
        cin.clear();
        cin.ignore();
    }
    else {
        return input;
    }
    return input;
}//closes function

long input_prot (string prompt, string err, long lower){
    long input;
    cout<<prompt;
    cin>>input;
    if (cin.fail()){ //if it isn't even a long
     cout<<"invalid input'/n'";
        cin.clear() ;
        cin.ignore();
    }
    else if (lower >input){ //long but out of bounds 
        cout<<err<<endl ;
        cin.clear();
        cin.ignore();
    }
    else {
        return input;
    }
    return input;
}//closes function 


thanks for anyone's help
1
2
3
4
5
double input_prot (string prompt, string err, double upper)
double input_prot (string prompt, string err, double lower)

long input_prot (string prompt, string err, long upper)
long input_prot (string prompt, string err, long lower)


Overloaded functions must differ in the parameter types, not only in the names. So the compiler sees them as the same and therefore redundant.
Thank you!
To fix it, I just switched around the parameters so that the same types wouldn't line up. After a little more debugging, the program runs perfectly now.
Topic archived. No new replies allowed.