TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: CHRISTIAN FELDE
date: 1997-12-28 14:46:00
subject: strcmpi error?

Hi all...
I have a problem here. I use Linux as my main OS, and therefor do all my c++ 
codeing in Linux too. I'm now using "Instant C++ Programming" by Ian Wilks to 
learn c++, and in a program made after reading from that book, I shall use 
strcmpi().
The source code look like this:
[start]
// strcmpi.cpp
// Ian M Wilks
#include 
#include 
void main()
{
  char yes[] = "yes";
  char no[] = "no";
  char input[4];
  char question[] = "\t\nAnyone can fall in love.\n\n";
  char response1[] = "\t\nYou are an incurable romantic.\n\n";
  char response2[] = "\t\nHow sad!\n\n";
start:
  cout << "\n\tDo you agree with the following statement - \n"
       << question << "\t\t\t";
  cin >> input;
  if (strcmpi(input, yes) == 0)
    cout << response1;
  else
    if (strcmpi(input, no) == 0)
      cout << response2;
  else
    {
      cout << "\n\t\tIncorrect Response";
      goto start;
    }
}
[stop]
When I try to compile it, I get this error:
[start]
sco-systems:~/work/code# g++ -o strcmpi strcmpi.cpp strcmpi.cpp: In function 
`int main(...)': strcmpi.cpp:25: warning: implicit declaration of function 
`int strcmpi(...)'
/tmp/cca003361.o: In function `main':
/tmp/cca003361.o(.text+0xbb): undefined reference to `strcmpi'
/tmp/cca003361.o(.text+0xe9): undefined reference to `strcmpi'
sco-systems:~/work/code#
[stop]
To me (as a newbee in c++) it look's like the compiler don't understand the 
useage of strcmpi.
Why is that? Is it me who's doing something wrong? You tell me.
Thanks for all help..
         __ __ __ __ _  _
        /_ // / // ///\//      email: scooby@applausenett.no
_ _ __ __//_ /_//_//_///    homepage: http://www.applausenett.no/~scooby/
--- BBBS/L v3.33 How
---------------
* Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.