Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c |
| Subject | Re: Memorry error? |
| Date | Sat, 07 Nov 2015 13:37:10 -0800 |
| Organization | None to speak of |
| Lines | 16 |
| Message-ID | <lnbnb51oft.fsf@kst-u.example.com> (permalink) |
| References | <892c6f15-df18-4132-a798-5fed68982edc@googlegroups.com> <a3ba5a3a-fe62-43f1-87bc-5d0df2dd2882@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="27638"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7K2uEynRdtyOuXDNMbKwB" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:G502SSF2eUmoHn91MkoHo5les7Y= sha1:CRkJPj6qy3HbHBAJaa1ShxX4jGs= |
| Xref | csiph.com comp.lang.c:75295 |
Show key headers only | View raw
Alla _ <modelling.data@gmail.com> writes:
> Most likely, they used free() because they have the so called
> GetString ()function which plays the role of scanf and fgets, and
> returns the address of the string (as scanf does, if I understood it
> correctly).
> I use fgets. Doesn't it allocate a memory for the string it gets from
> a user?
No. If fgets allocated memory for the string, you would't have to give
it a pointer to an existing string.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:18 -0800
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:19 -0800
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:27 -0800
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:30 -0800
Re: Memorry error? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-07 08:36 -0500
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 06:43 -0800
Re: Memorry error? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-07 17:22 +0000
Re: Memorry error? "Osmium" <r124c4u102@comcast.net> - 2015-11-07 07:33 -0600
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 06:47 -0800
Re: Memorry error? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-07 10:36 -0500
Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-07 13:37 -0800
Re: Memorry error? Barry Schwarz <schwarzb@dqel.com> - 2015-11-07 16:26 -0800
Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-08 23:03 -0800
Re: Memorry error? Barry Schwarz <schwarzb@dqel.com> - 2015-11-09 01:01 -0800
Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-09 08:27 -0800
Re: Memorry error? raltbos@xs4all.nl (Richard Bos) - 2015-11-17 22:23 +0000
Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-17 15:31 -0800
Re: Memorry error? raltbos@xs4all.nl (Richard Bos) - 2015-11-19 10:41 +0000
Re: Memorry error? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-11-09 10:26 +0000
csiph-web