Witajcie
Mam taki problem jak w temacie. Tworzę sobie obiekt pole i chcę wydobyć z niego wartość. Program niestety nie chce ruszyć i nie wiem dlaczego. Wyskakuje WARNING: warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data. Wiem że informuje mnie o możliwej utracie danych ale mnie to nie obchodzi na razie. Co jest nie tak?
Kod programu:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
class pole
{
private:
int stan;
int wlasciwosc;
public:
pole();
~pole();
int wyswietl();
};
pole::pole()
{
stan=rand()%2;
wlasciwosc=rand()%4;
}
int pole::wyswietl()
{
//cout<<stan;
//printf("%d",stan);
return stan;
}
class plansza
{
};
int main()
{
using namespace std;
srand( time( NULL ) );
pole test;
pole *a;
a=&test;
printf("%d",a->wyswietl());
system("pause");
return 0;
}