c++ definiowanie

0

Mam problem nie wiem w ogóle o co chodzi. Program sie nie kompiluje.kompilator wywala mi takie oto bledy :
multiple definition of 'menumiasto()'
first defined here
multiple definition of 'sklep()'
first defined here
multiple definition of 'miasto()'
first defined here
Id returned 1 exit status

Oto caly kod

#include <windows.h>
#include <fstream>
#include <iostream>
using namespace std;

void menumiasto()
{
     cout<<"Jestes teraz w miescie"<<endl;    
     cout<<"[1] Sklep"<<endl;
     cout<<"[2] Misje"<<endl;
     cout<<"[3] Podroze"<<endl; 
     cout<<"Wybor? : "<<endl;
}
void sklep()
{
     
     cout<<"Jestes teraz w sklepie u \"Tatka\""<<endl;
     cout<<"[1] Kup bron"<<endl;
     cout<<"[2] Sprzedaj bron"<<endl;
     cout<<"[3] Kup jakies eqn"<<endl;
     cout<<"[4] Sprzedaj eqn"<<endl;
     cout<<"Wybor? : "<<endl;
}

int miasto()
{
    char znak;
    menumiasto();
    cin>>znak;
    switch(znak){
                  case 1:
                         sklep();
                  default: 
                          cout<<"Zly znak !!"<<endl;
                 }     
    
}
 

Moze mi ktos powiedziec jak to zdefiniowac??

0
#include <windows.h>
#include <fstream>
#include <iostream>
using namespace std;

int menumiasto()
{
     cout<<"Jestes teraz w miescie"<<endl;    
     cout<<"[1] Sklep"<<endl;
     cout<<"[2] Misje"<<endl;
     cout<<"[3] Podroze"<<endl; 
     cout<<"Wybor? : "<<endl;
     int znak;
     cin >> znak;
     return znak;
}
void sklep()
{
     
     cout<<"Jestes teraz w sklepie u \"Tatka\""<<endl;
     cout<<"[1] Kup bron"<<endl;
     cout<<"[2] Sprzedaj bron"<<endl;
     cout<<"[3] Kup jakies eqn"<<endl;
     cout<<"[4] Sprzedaj eqn"<<endl;
     cout<<"Wybor? : "<<endl;
}

int main() //tu byl najwiekszy blad :D
{
    int znak = menumiasto();
    switch(znak){
                  case 1:
                         sklep();
                  default: 
                          cout<<"Zly znak !!"<<endl;
                 }     
    
}
 

1 użytkowników online, w tym zalogowanych: 0, gości: 1