|
-
Aug 7th, 2001, 08:18 AM
#1
What's wrong with this code?
I'm trying to randomize 4 words and then put 3 of them into a editbox.
My code looks like this:
Code:
char c[4][10] = {"Hello","Hi","Good Day","Whatever"};
void CTestingDlg::OnOK()
{
srand((unsigned)time(NULL));
for (int i=0;i<3;i++) {
SetDlgItemText(IDC_EDIT1, c[rand() % 4]);
}
Now the problem is that the editbox just puts out one line, not 3 as I want.
I have tried to set "Multiline" and "Want return" but that doesn't work either.
Can someone please help?
-
Aug 7th, 2001, 08:21 AM
#2
Member
You didn't close the brace.
-
Aug 7th, 2001, 08:39 AM
#3
Oh, no I didn't forget to close the brace in my code but it got wrong when I posted it here Sorry...
-
Aug 7th, 2001, 08:43 AM
#4
Member
It looks fine. Try outputting it to stdout (with printf or cout).
-
Aug 7th, 2001, 08:47 AM
#5
Yeah i tried to make a console progg and it worked fine. It seems that the editbox is a little messed up or something. It seems that I can't send a couple words to it... it only prints out one
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
|