Header file strings.h

Rick Genter rgenter at bbn-labs-b.arpa
Wed Jun 18 18:33:05 AEST 1986


In article <8606171617.aa10712 at VGR.BRL.ARPA>,
"1LT Dennis G. Rears" (FSAC) <drears at ardec.ARPA> writes:

> Paul Schauble writes:
> 
> >I am trying to port a program from Unix to MS-DOS.  It makes use of a
> >header file <strings.h>.  This is not supplied with Microsoft C.  Could
> >someone please enlighten me as to what this contains?
> 
>    <strings.h>  contains the data types for the string
> operations - strcat, strncat, strtok, strcpy, etc.  I have used the

More precisely, it contains the external declarations of these functions.
One could misinterpret the above statement to mean that <strings.h> contains
the data types *manipulated* by the string functions (which it does not).

> strings functions many times without using this header file.  If
> you are checking the return codes of the functions explicitly define
> the functions.  Example:
> 
> char *strcat(), *strcmp();

In every implementation of strcmp() with which I am familiar, it returns (int),
not (char *).  Its return value is suitable for the old Fortran 3-way IF (i.e.,
returns < 0 if string-1 comes before string-2 in dictionary order, = 0 if they
are the same, and > 0 if string-1 comes after string-2).

> int strlen;

This should read:

	int	strlen ();

> 
>    I believe Microsoft C libraries contains the string functions. In
> that case just explicitly define the functions. If they don't  you might
> have to write the string functions yourself.
> 
> Dennis
> 
--------
Rick Genter 				BBN Laboratories Inc.
(617) 497-3848				10 Moulton St.  6/506
rgenter at labs-b.bbn.COM  (Internet new)	Cambridge, MA   02238
rgenter at bbn-labs-b.ARPA (Internet old)	linus!rgenter%BBN-LABS-B.ARPA (UUCP)



More information about the Comp.unix mailing list