unsigned/signed mismatch in MSC 6.0
H.L. Stahl
hls at rwthbs.uucp
Sat Nov 24 02:56:38 AEST 1990
In article <2301 at sparko.gwu.edu> timur at seas.gwu.edu () writes:
>I'm using Microsoft C 6.0, and I have my warnings set to level 4. I'm
>getting an error with this expression:
>
>strlen(s)<WIDTH
>
> ...
In MS-C (and ANSI C ?) the return type of "strlen" is defined as "size_t",
which is defined as "unsigned int" in MS-C.
But
strlen(s) < (size_t)(WIDTH)
should work ...
| _ : Hans-Ludwig Stahl, Lehrstuhl fuer Betriebssysteme, RWTH Aachen
|_|_`__ : Kopernikusstr. 16, D-5100 Aachen, ..49-(0)241-804374
| |__) : Domain: hls at informatik.rwth-aachen.de
|__) : uucp: ...!{seismo,mcvax,uunet}!unido!rwthinf!hls
More information about the Comp.lang.c
mailing list