السلام عليكم ورحمه الله وبركاته
اريد كتابه برنامج بالستخدام ال C++ يقوم بحساب الفرق بين عمر المستخدم (مدخل) والتاريخ الموجود في نفس الجهاز
المشكله عندي هي في كيفيه معرفه وقت الجهاز
استخدمت ال هيدر فايل time.h وكتبت الكود هذاكبدايه الا انه يظهر لي error
#include<time.h>
int main()
{
using std::cout;
using std::cin;
using std::endl;
struct tm*local; //pointer to time structure
time.t;
t=time(NULL); //stror time in t
local=localtime(&t); //fill the structure pointed date
cout<<"The current date is "<<local->tm_mday<<std::endl;
cout<<"The current month is "<<local->tm_mon<<std::endl;
cout<<"The current year is "<<local->tm_year<<std::endl;
return 0;
}والخطا كما يظهر
error C2228: left of '.t' must have class/struct/union type
الحقيقه هذي المره الاولى التي اتعامل معها مع ال time :(
