[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C strstr function returns int or char *?



Brian May <bam@debian.org> wrote:
>While compiling:
>
>char *a = strstr("hello", "ccache=");
>
>
>Warning:
>
>pam_krb5_auth.c:287: warning: initialization makes pointer from integer
>without a cast
>
>
>So, why is an integer expected??????

You have said '#include <string.h>', haven't you? (Without a prototype,
a return type of int is assumed.)

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: