Witam, ćwiczę obiektowe programowanie. na razie jestem na poziomie zerowym, ale mam takie problemy.
#include <iostream>
#include <cstdlib>
using namespace std;
class stos{
private:
int *tab;
public:
stos(){}
stos(int t){
this->tab=new int(t);
}
};
int main()
{
stos tro=new stos(6);
return 0;
}
wywala kompilator takie błędy:
error: invalid conversion from 'stos*' to 'int' [-fpermissive]
note: initializing argument 1 of 'stos::stos(int)'
co jest nie tak?