tcpdump mailing list archives

Re: Error in the "strcat" function


From: Guy Harris <guy () alum mit edu>
Date: Mon, 19 Feb 2007 00:24:42 -0800

Adelmo Silva wrote:
But, if I wrote:
strcat(string1, &ips1[i]);

Another error happen:
teste1.c:294: error: incompatible types in assignment

So, on line 294 of testel.c, did you write

        strcat(string1, &ips1[i]);

or did you write

        string1 = strcat(string1, &ips1[i]);

I suspect you wrote

        string1 = strcat(string1, &ips1[i]);

in which case you made a mistake, and the compiler correctly told you so - you cannot assign a "char *", which is what the return value of strcat() is, to an array.

You need to write just

        strcat(string1, &ips1[i]);

with no assignment.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: