Results 1 to 2 of 2

Thread: Making a string

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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(ithei20);
            
    strcat(valthei);
            
    MessageBox(NULL,thei,thei,MB_OK);
        
    //Get the caption of the item based on its index
        
    SendMessage(chCB_GETLBTEXTi, (LPARAM)buffer);
        
    //Add the item to the registry key
        
    RegSetValueEx(regkeyval0REG_SZ, (LPBYTE)bufferstrlen(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

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    nop, thanks for trying but it gives me an assertion error message

    I will see if I freezes or something else bad happens with my code
    Baaaaaaaaah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width