🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2051

Re: "1234" ==> 1234 (char * ==> int)

#2051
From: Henry Spencer
Date: Thu, 13 Dec 1990 04:47
8 lines
731 bytes
In article <1990Dec12.215359.5378@cs.utk.edu> lape@.cs.utk.edu (Bryon S. Lape) writes:
>	I need to know how to convert a string of numbers into an int.
>For example, "1234" ==> 1234...

Use the atoi() or atol() function from the C library.
-- 
"The average pointer, statistically,    |Henry Spencer at U of Toronto Zoology
points somewhere in X." -Hugh Redelmeier| henry@zoo.toronto.edu   utzoo!henry
Technical Details
Message-ID: <1990Dec13.044726.14433@zoo.toronto.edu>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <1990Dec12.215359.5378@cs.utk.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.lang.c
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: "1234" ==> 1234 (char * ==> int)
Message-ID: <1990Dec13.044726.14433@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <1990Dec12.215359.5378@cs.utk.edu>
Date: Thu, 13 Dec 90 04:47:26 GMT