Thread: strcmpi()

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    11

    Unhappy strcmpi()

    ok i am building a binary tree of char strings and i am trying to use the strcmpi() function to compare strings.
    i have
    if(strmpi(string,leaf->nstring) < 0)
    so if the string is less than the current node string 'nstring' it will be negative causing it to be less than 0 right?

    however when i try and compile i only have this one error ;(

    btreei.cpp: In method `void binary_tree_node::insert(char *, int, node *)':
    btreei.cpp:29: implicit declaration of function `int strcmpi(...)'
    am i using the function properly syntax wise and everything or am i just using the wrong kind of funtion for this situation :P


    Siciliano_---
    ...

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    12
    I believe you want stricmp() and not strcmpi()
    and make sure you #include <string> or <string.h>

  3. #3
    Unregistered
    Guest
    its strcmp() =D

  4. #4
    Unregistered
    Guest
    hmm everyone is telling me there is no strcmpi or stricmp? is this in the standard header file library?

    o well i will just use strcmp and convert all the words to lowercase before comparing
    thanks



    Siciliano_--

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >hmm everyone is telling me there is no strcmpi or stricmp? is this
    >in the standard header file library?
    No, it's not a standard function.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. alternative to strcmpi
    By ehj3000 in forum C Programming
    Replies: 6
    Last Post: 12-12-2005, 07:09 PM
  2. HELP with strlen and strcmpi
    By unejam2005 in forum C++ Programming
    Replies: 2
    Last Post: 12-11-2005, 03:01 AM
  3. some questions about strings
    By ali1 in forum C++ Programming
    Replies: 8
    Last Post: 07-18-2004, 06:39 PM
  4. basic strcmpi question
    By Noobie in forum C++ Programming
    Replies: 3
    Last Post: 05-04-2003, 02:50 PM
  5. how do I do "this or that" with strcmpi
    By Noobie in forum C++ Programming
    Replies: 17
    Last Post: 02-04-2003, 04:41 PM