CDateTimeCtrl Problem

Started by
1 comment, last by chakrdeep 19 years, 10 months ago
Hi all, I have a CDateTimeCtrl in a form view. When a user clicks on a get time button, I retrieve the time using the following code: CTime time; DWORD dwResult = m_TimeSetter.GetTime(time); int timeSec = time.GetSecond(); printf("\n timeSec %d",&timeSec); The value of timeSec is printed out as 1243036 even when the Control''s second field is set to zero. Any thoughts ? .. tx
Advertisement
Change

printf("\n timeSec %d", &timeSec);

to

printf("\n timeSec %d", timeSec);

Don''t use ampersands for printf''ing stuff, only for scanf''ing stuff.

ain''t the fool? ... yup u were right .. tx


This topic is closed to new replies.

Advertisement