#include<iostream>
#include <stdlib.h> /* srand, rand */
#include <time.h>
using namespace std;
int main()
{
int num,total_try,user_num;
srand (time(NULL)); ???Error ขึ้นว่า 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
/* generate secret number between 1 and 10: */
num = rand() + 1;
cout<<"Give number 1-10 :";
cin>>num;
total_try=0;
do {
cout<<"Give number 1-10 :";
cin>>user_num;
if (num<user_num) puts ("The secret number is lower");
else if (num>user_num) puts ("The secret number is higher");
total_try=total_try + 1;
} while (num==user_num);
cout<<"total try="<<total_try<<endl;
return 0 ;
}
ไม่เข้าใจว่า ERROR จะให้แก้ยังไงหรอครับ