|
-
May 23rd, 2005, 02:37 AM
#5
Re: How can I display current Time in a Static text.
Do you even understand the function Format?
Check out the function description in MSDN.
For every %d, %s or whatsoever, you should add values.
So, if you want to add integers and strings to a string, use this code:
Code:
CString sExample = "hello";
int iExample = 5;
CString sFinalString;
// Because the first % is a s, we should first add the sExample as parameter
sFinalString.Format("%s, how are you doing? This is a number: %d", sExample, iExample);
The value if sFinalString will be:
hello, how are you doing? This is a number: 5
Do you understand?
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
|