Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!rutgers!lll-lcc!well!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Re: TC thanks & another question... Message-ID: <2614@hoptoad.uucp> Date: Mon, 3-Aug-87 07:21:38 EDT Article-I.D.: hoptoad.2614 Posted: Mon Aug 3 07:21:38 1987 Date-Received: Tue, 4-Aug-87 01:55:15 EDT References: <1255@killer.UUCP> Organization: Nebula Consultants in San Francisco Lines: 23 robertl@killer.UUCP (Robert Lord) wrote: > data.sqle is defined in my structure (an include file) as type 'long int'. > data.sqft is a string consisting of some numeral value (yes, with quotes > and starting at [0] :-). Now why does the command: > > data.sqle = atol(data.sqft); > > go crazy when I give it anything larger than 32000 (by 'going crazy' I mean > giving the usual wierd numbers that have no connection with the origional > one at all)? Let me guess. Did you declare: long atol(); somewhere in your source file? Without this, the compiler does not know that atol() is returning a 32-bit result, if your ints are 16 bits. I recommend running "lint" on your programs, it will catch things like this without your having to debug it. -- {dasys1,ncoast,well,sun,ihnp4}!hoptoad!gnu gnu@postgres.berkeley.edu Alt.all: the alternative radio of the Usenet.