[comp.lang.c] ltoa

ftw@datacube.UUCP (11/30/87)

It looks as though ltoa() is a function that takes a long int and buffer
address as args, places a "printable" representation of the long at that
address, and returns the number of characters written to that buffer.
ftell() plays back the position of the "file pointer", or more accurately,
tells you how many bytes into the file you are.  Its return value is
a long int.


				Farrell T. Woods 

Datacube Inc. Systems / Software Group	4 Dearborn Rd. Peabody, Ma 01960
VOICE:	617-535-6644;	FAX: (617) 535-5643;  TWX: (710) 347-0125
INTERNET: ftw@datacube.COM
UUCP: {rutgers, ihnp4, mirror}!datacube!ftw

PEPRBV%CFAAMP.BITNET@wiscvm.wisc.EDU (Bob Babcock) (12/01/87)

bagpiper@oxy.uucp asks
>Could anybody tell me what the ltoa function is suppose to do.  I think that
>it was in the library for the CI86 compiler.  I would also like to know
>about the rindex function [index is the same as strchr...then what is rindex?].

In CI86, ltoa(n,buffer) converts long integer n to an ascii string in
buffer (which should be at least 12 characters long).
rindex(string,cc) is the same as strrchr, finds last occurrence of
character cc in string.

chip@ateng.UUCP (Chip Salzenberg) (12/02/87)

In article <10594@brl-adm.ARPA>,
	PEPRBV%CFAAMP.BITNET@wiscvm.wisc.EDU (Bob Babcock) writes:
>rindex(string,cc) is the same as strrchr, finds last occurrence of
>character cc in string.

Except for the fine point that strchr() and strrchr(), when given a second
parameter of zero, they return the address of the string's terminating NUL
('\0').  I don't think that this behavior can be expected of index() and
rindex().
-- 
Chip Salzenberg         "chip@ateng.UUCP"  or  "{codas,uunet}!ateng!chip"
A T Engineering         My employer's opinions are not mine, but these are.
   "Gentlemen, your work today has been outstanding.  I intend to recommend
   you all for promotion -- in whatever fleet we end up serving."   - JTK