|
-
August 26th, 2002, 02:14 PM
#8
[QUOTE]quote:
--------------------------------------------------------------------------------
Also is there a way of shortening the whole program using wsprintf?
--------------------------------------------------------------------------------
sscanf or CString::Format can shorten your code a great deal:
code:--------------------------------------------------------------------------------CString getLogFilename()
{
CTime time = CTime::GetCurrentTime();
CString filename;
output.Format("%i/%i/%i", time.GetYear(), time.GetMonth(), time.GetDay());
return filename;
}
QUOTE]
Even simpler to use CTime::Format.
Code:
CString getLogFilename()
{
CTime time = CTime::GetCurrentTime();
CString filename = time.Format("%Y/%m/%d");
return filename;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|