Skip to main content
GameDev.net gamedev.net
🔒 Locked

CDateTimeCtrl Problem

Started by chakrdeep Jun 9, 2004 at 8:26 PM 1 replies 500+ views
Original Post
chakrdeep
chakrdeep
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
Aprosenf
Aprosenf
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.
chakrdeep
chakrdeep

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


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.