Re: Whois Problems...

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 01/12/02


On Sat, Jan 12, 2002 at 07:52:04PM -0500, Bejhan Jetha wrote:
>Okay I got a few problems with do_whois and I don't know why,
I know why, as I'm sure most of this list has figured out by now too.
> maybe you can help me.
I'll try:
"The C Programming Language" Brian Kernighan & Dennis Ritchie
http://bioinfo.ernet.in/~sanjay/ctutor/c-lesson/c-lessons.html
http://www.programmersheaven.com/zone3/cat36/16031.htm
and let's just throw in:
http://www.google.com/search?q=ctutor&btnG=Google+Search

>act.informative.c: In function `do_whois':
>act.informative.c:1896: parse error before `else'
Did you look here to see?  It's pretty obvious.

>act.informative.c:1882: warning: unused variable `tmp'
>act.informative.c:1881: warning: unused variable `tmp_store'
>act.informative.c: At top level:
This line is a REAL good indicator that you didn't count your ()'s or
{}'s or []'s right.  Lots of editors will highlight mismatched parens
for ya, but good indenting is also a good way to notice it.

>make: *** [circle] Error 2
>
>
>The function:
>
>ACMD(do_whois)
>{
>  struct char_data *victim;
>  struct char_file_u tmp_store;
>  int tmp;
>
>  one_argument(argument, buf1);
>
>  if (!*buf1) {
>    send_to_char("Who?\r\n", ch);
>    return;
>  }
>
>  else {
>    if ((victim = get_player_vis(ch, buf1, FIND_CHAR_WORLD)) != NULL)
>      do_whois_function(ch, victim);
>  }
>
>  else {

There is no "if-else-else" construct in c.
perhaps you meant:
 }

 else {
  if(victim=...) {
    do_whois...
  }

  else {

maybe followups-to comp.lang.c ?

-me

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT