Thread: stricmp

  1. #1
    eat my shorts!
    Join Date
    Apr 2002
    Posts
    294

    stricmp

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    Code:
                            if (nC!=1 && nI==1 && stricmp(buffer, SearchString))
                                    if (nN!=1)
                                            printf ("%s", buffer);
                                    else
                                            printf ("%d: %s", Total_Line_Counter, buffer);
    Platform Fedora Linux GCC

    Error:
    /tmp/cc01xP9R.o(.text+0x427): In function `main':
    : undefined reference to `stricmp'
    collect2: ld returned 1 exit status
    Games Reviews Previews Desktop Themes Downloads Paintball Forums Shareware Freeware and much more

    The best in Technology and Gaming News

    www.back2games.com

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    I don't believe that stricmp is a standard function.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    29
    Do you mean strcmp()?

  4. #4
    eat my shorts!
    Join Date
    Apr 2002
    Posts
    294
    no, i mean case insensitive search: "stricmp"; i know strcmpi is standard, but that gives same error.
    Last edited by dayknight; 09-23-2005 at 07:15 PM.
    Games Reviews Previews Desktop Themes Downloads Paintball Forums Shareware Freeware and much more

    The best in Technology and Gaming News

    www.back2games.com

  5. #5
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    try strcasecmp under Linux

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    stricmp() is not a standard function. However, you can write it yourself.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    All case-insensitive compare functions are non-standard, so you have to find the one used on your local system, or write your own.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console Font Size
    By bradszy in forum Windows Programming
    Replies: 34
    Last Post: 04-26-2008, 07:09 AM
  2. Replies: 1
    Last Post: 07-12-2005, 09:03 PM
  3. stricmp() where can I view the sample code?
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 06-28-2002, 08:40 AM