Mam pewien program i staram się go przerobić na kilka plików źródłowych ale cały czas wywala mi error. Może ktoś bardziej ogarnięty pomorze.
main.cpp
#include <iostream>
#include <ctime>
#include <conio.h>
#include <cstdlib>
#include "Klasy.hpp"
using namespace std;
int main(/*int argc, char *argv[]*/)
{
Pies Burek ;
Burek.ustawKolor("Czarny");
Burek.ustawWzrost( 90 );
string kolor = Burek.wypiszKolor();
int wzrost = Burek.wypiszWzrost();
cout<<endl<<"Kolor: "<<kolor<<", Wzrost: "<<wzrost<<endl<<endl;
Burek.szczekaj(10);
system("PAUSE");
return EXIT_SUCCESS;
}
Klasy.hpp
#ifndef Klasy_hpp
#define Klasy_hpp
class Pies;
#endif
Klasy.cpp
#include "Klasy.hpp"
using namespace std;
class Pies
{
private:
string kolor;
int wzrost;
public:
void ustawKolor( string wybrany_kolor )
{
kolor = wybrany_kolor;
}
void ustawWzrost( int wybrany_wzrost )
{
wzrost = wybrany_wzrost;
}
string wypiszKolor()
{
return kolor;
}
int wypiszWzrost()
{
return wzrost;
}
void szczekaj(int ile)
{
cout<<endl;
for (int i=0; i<ile; i++){
cout<<"Hau ";
}
cout<<endl<<endl<<endl;
}
};