Cześć. Mam problem z odpaleniem takiego testowego programu z programowania obiektowego, czy mógłby ktoś wytłumaczyć co robię nie tak? Dodatkowo przykładowe kody z filmów na yt też mi nie działają.
#include <iostream>
#include "test1.h"
using namespace std;
void dlugopis::wczytaj(){
cout << "Podaj nazwa" << endl;
cin >> nazwa;
cout << "Podaj dlugosc" << endl;
cin >> dlugosc;
cout << "Podaj kolor" << endl;
cin >> kolor;
}
void dlugopis::wyswietl(){
cout << nazwa << endl;
cout << dlugosc << endl;
cout << kolor << endl;
}
#include <iostream>
#include <string>
#include "test1.h"
using namespace std;
int main(){
dlugopis p1;
p1.wczytaj();
p1.wyswietl();
return 0;
}
#include <iostream>
using namespace std;
class dlugopis{
public:
string nazwa;
int dlugosc;
string kolor;
void wczytaj();
void wyswietl();
};