According to Patrick:
> strstr(haystack,needle) only allows my search string to be a single
> character.  I am wondering if anyone could help me do something like
> this:
> 
> char *needle_position = strstr(ref,'cart_id')
> 
> ..to return the position of that search string within ref.  Thanks
> in advance.

No, strstr() looks for a substring within a string.  strchr() looks for
a single character.  However, strings must be in double quotes.  You want
something like

    char *needle_position = strstr(ref, "&cart_id");
    if (needle_position)
        *needle_position = '\0';

Do this after the anchor is stripped off.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] 
You will receive a message to confirm this. 


Reply via email to