Results 1 to 4 of 4

Thread: question about _memicmp C runtime function

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Question question about _memicmp C runtime function

    I have a stupid question here, I using the following code to compare two string without consider the case.

    So my question is, will the _memicmp cause any memmory leak?

    PHP Code:
    for (idx 0idx 3000idx++)
    {
        
    Ret _memicmp(BuildRef[idx].NameLocationstrlen(Location));
        if (
    Ret == 0)
        {
            
    // Do all my logic here
        
    }

    regards,

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I think stricmp would probably be a better choice for this.

    And no, since it doesn't allocate memory it won't leak any.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    your code wouldn't work anyway, because it would be case-sensitive

    All the buzzt
    CornedBee

  4. #4

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    yup, it work fr me, 'coa I juz wanna to compare 2 string without consider the upper/lower case.
    like:

    President Suite is equal to PREsident SuiTE

    regards,

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