|
-
Sep 2nd, 2001, 09:23 PM
#1
You're asking the wrong guy if you want a real answer , but I would imagine that it would be better to declare it outside of the loop, since it is just being used over and over.
PHP Code:
for(i=0;i<index;i++)
{
char val[100] = "his";
itoa(i, thei, 20);
strcat(val, thei);
MessageBox(NULL,thei,thei,MB_OK);
//Get the caption of the item based on its index
SendMessage(ch, CB_GETLBTEXT, i, (LPARAM)buffer);
//Add the item to the registry key
RegSetValueEx(regkey, val, 0, REG_SZ, (LPBYTE)buffer, strlen(buffer)+1);
delete [] val; //added
}
I imagine that would be better for memory usage, but don't take my word as fact
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 2nd, 2001, 09:31 PM
#2
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
|