i need help

i cant get this to work iv got a dir like this bin(eng.cpp and deu.cpp)main.cpp
in the main file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  #include <iostream>
#include "bin/eng.cpp"
#include "bin/deu.cpp"

using namespace std;

int main()
{
    int lang = 0;
    cout << "1-eng" << endl;
    cout << "2-deu" << endl;
    cin >> lang;
    if (lang== 1);{
    eng();
    return 0;
    }
    if (lang== 2);{
    deu();
    return 0;
    }

    return 0;
}

in the eng file
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
#include <iostream>

using namespace std;

int eng()

{

    int inputa = 0;

cout << "hello and welcome to the calculator menu" << endl;
cout << "1- for simple 1 step problem" << endl;
cout << "2- for 2 step problem" << endl;
cout << "3- for 3 step problem" << endl;
cout << "4- for number to hex max 255" << endl;
cout << "5- for number to binary max 255" << endl;
cout << "6- to exit" << endl;

cin >> inputa;

if(inputa== 1);{}
if(inputa== 2);{}
if(inputa== 3);{}
if(inputa== 4);{}
if(inputa== 5);{}
if(inputa== 6);{goto end;}
end:

return 0;
}

and the deu file is coming soon
the error is(
in function ´z3engv´:
7 multiple definition of ´eng()´
"red text" 7 first defined here
and my compiler is code::block
Do not include the *.cpp.

Further more: it's plain wrong to have a ; right after an if clause (nothing will happen if you do so / the clause ends there). Simply remove the semicolon.
ok thanx:)
i got i working
but i still get the erorr
Last edited on
Deu file?
So, what did you change and what is the error?
Topic archived. No new replies allowed.