Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Should you free your pointers?

Reply
Thread Tools

Should you free your pointers?

 
 
Michael Press
Guest
Posts: n/a
 
      06-28-2011
In article <iubl3b$d6o$(E-Mail Removed)>,
Billy Mays <(E-Mail Removed)> wrote:

> On 6/27/2011 11:05 PM, J. J. Farrell wrote:
> > Michael Press wrote:
> >> In article <(E-Mail Removed)>,
> >> Keith Thompson <(E-Mail Removed)> wrote:
> >>
> >>> James Kuyper <(E-Mail Removed)> writes:
> >>>> On 06/25/2011 06:44 PM, Keith Thompson wrote:
> >>>>> Michael Press <(E-Mail Removed)> writes:
> >>>>>> In article <iu3d2t$qlh$(E-Mail Removed)>,
> >>>>>> Eric Sosman <(E-Mail Removed)> wrote:
> >>>> ...
> >>>>>>> This is Question 7.24 on the comp.lang.c Frequently Asked
> >>>>>>> Questions (FAQ) page at <http://www.c-faq.com/>.
> >>>>>> FAQ was once frequently answered questions.
> >>>>> Um, it still is.
> >>>> I presume that he's commenting on the difference between "Asked" and
> >>>> "Answered".
> >>> I must admit I didn't notice that he changed the word from "asked" to
> >>> "answered".
> >>>
> >>> Now that I've noticed, I'm not sure I've ever seen FAQ expanded
> >>> to "Frequently Answered Questions" rather than "Frequently Asked
> >>> Questions", and I still have no idea what Michael is getting at.
> >>> Is he suggesting that Eric should have done something other than
> >>> cite the FAQ?
> >>>
> >>> Sorry if I'm being dense.
> >>
> >> Originally FAQ stood for frequently answered questions.
> >> Most people do not seem to know that, even more than I thought going
> >> in. During the transition, some people
> >> attempted to stem the tide.

> >
> > Evidence please. I've known it to be an abbreviation of "Frequently
> > Asked Questions" for several decades, this is the first time I've seen a
> > suggestion that it is "Frequently Answered Questions".

>
> I think "Asked" fits better since the complement would be Infrequently
> Asked Questions rather than Frequently Unanswered Questions.


There are frequently asked questions that
never get into the FAQL such as

"Are you serious?"
"What's your point?"
"Is it congenital or were you dropped on your head?"

--
Michael Press
 
Reply With Quote
 
 
 
 
James Kuyper
Guest
Posts: n/a
 
      06-28-2011
On 06/27/2011 03:59 PM, Michael Press wrote:
....
> Originally FAQ stood for frequently answered questions.
> Most people do not seem to know that, even more than
> I thought going in. During the transition, some people
> attempted to stem the tide.


According to Google Groups, the oldest usenet message containing
"Frequently Answered Questions" was dated 1989-03-22. It could only find
14 such messages between then and 1991-01-1.

The oldest message it reports containing the phrase "Frequently Asked
Questions" dates back to 1981-07-13, and there are 11,200 such messages
between then and 1984-01-01. The very first such message connects that
phrase to the acronym "FAQ", contradicting the chronology given for the
birth of that acronym in Wikipedia's entry for "FAQ".

Google Groups' query engine is extremely flaky, but these numbers and
dates are at least suggestive of a different history than the one you
describe.
--
James Kuyper
 
Reply With Quote
 
 
 
 
Joe Pfeiffer
Guest
Posts: n/a
 
      06-28-2011
Michael Press <(E-Mail Removed)> writes:

> In article <iubgdq$meo$(E-Mail Removed)>,
> "J. J. Farrell" <(E-Mail Removed)> wrote:
>
>> Michael Press wrote:
>> > In article <(E-Mail Removed)>,
>> > Keith Thompson <(E-Mail Removed)> wrote:
>> >
>> >> James Kuyper <(E-Mail Removed)> writes:
>> >>> On 06/25/2011 06:44 PM, Keith Thompson wrote:
>> >>>> Michael Press <(E-Mail Removed)> writes:
>> >>>>> In article <iu3d2t$qlh$(E-Mail Removed)>,
>> >>>>> Eric Sosman <(E-Mail Removed)> wrote:
>> >>> ...
>> >>>>>> This is Question 7.24 on the comp.lang.c Frequently Asked
>> >>>>>> Questions (FAQ) page at <http://www.c-faq.com/>.
>> >>>>> FAQ was once frequently answered questions.
>> >>>> Um, it still is.
>> >>> I presume that he's commenting on the difference between "Asked" and
>> >>> "Answered".
>> >> I must admit I didn't notice that he changed the word from "asked" to
>> >> "answered".
>> >>
>> >> Now that I've noticed, I'm not sure I've ever seen FAQ expanded
>> >> to "Frequently Answered Questions" rather than "Frequently Asked
>> >> Questions", and I still have no idea what Michael is getting at.
>> >> Is he suggesting that Eric should have done something other than
>> >> cite the FAQ?
>> >>
>> >> Sorry if I'm being dense.
>> >
>> > Originally FAQ stood for frequently answered questions.
>> > Most people do not seem to know that, even more than
>> > I thought going in. During the transition, some people
>> > attempted to stem the tide.

>>
>> Evidence please. I've known it to be an abbreviation of "Frequently
>> Asked Questions" for several decades, this is the first time I've seen a
>> suggestion that it is "Frequently Answered Questions".

>
> The Wikipedia article on FAQ documents this usage.
>
> A web search for "frequently answered questions"
> turns up a myriad of sites where the list of frequently
> answered questions is titled "Frequently Answered Questions."


Hmmm.... googling frequently answered questions turns up 5,190,000
hits -- and the first one is a page titled "Frequently Questioned
Answers".

frequently asked questions turns up 222,000,000 hits.

Of course, the claim is that FAQ originally stood for "answered", so
relative use now is pretty much irrelevant.
 
Reply With Quote
 
David Mathog
Guest
Posts: n/a
 
      06-28-2011
On Jun 24, 2:05*pm, Ben Pfaff <(E-Mail Removed)> wrote:

> One reason that I sometimes bother is that it's very clear that a
> program that frees all of its memory does not have a memory leak
> (when I use a tool that reports memory statistics at program
> exit).


Exactly. But it isn't hard to have it both ways. In one of my
programs during development it looks like:

/* For memory leak testing
*/
free()
free()
....

and in production

/* For memory leak testing
free()
free()
....
*/

This could (maybe should) be done with an ifdef too. Anyway, this
particular program has complex memory structures, so it is easy to
introduce memory leaks and access violations, and the way I find these
is by running a large test suite using valgrind. (As opposed to the
same large testsuite without valgrind for routine testing.)

As an aside, finding memory leaks in tests that are forced to exit
through:

/* awful unrecoverable problem, exit immediately */
exit(EXIT_FAILURE);

is problematical, since at the exit point the code will rarely have
access to all of the data structures that (might) need to be freed.
The end result
is that in those sections of the testsuite under valgrind it looks
like a memory leak whether or not there really is one.

Regards,

David Mathog
 
Reply With Quote
 
J. J. Farrell
Guest
Posts: n/a
 
      06-29-2011
Michael Press wrote:
> In article <iubgdq$meo$(E-Mail Removed)>,
> "J. J. Farrell" <(E-Mail Removed)> wrote:
>> Michael Press wrote:
>>> Originally FAQ stood for frequently answered questions.
>>> Most people do not seem to know that, even more than
>>> I thought going in. During the transition, some people
>>> attempted to stem the tide.

>> Evidence please. I've known it to be an abbreviation of "Frequently
>> Asked Questions" for several decades, this is the first time I've seen a
>> suggestion that it is "Frequently Answered Questions".

>
> The Wikipedia article on FAQ documents this usage.


Not quite - it claims "Originally the term FAQ referred to the
Frequently Answered Question itself", but with no citation of any sort
to support the claim, and without even identifying the claimant.

Wikipedia does attribute the origin of the acronym FAQ to Eugene Maya on
the SPACE mailing list, and http://www.islandone.org/SpaceDigest/
confirms that Maya originally used the term to mean Frequently Answered
Questions. Since there are records of the term Frequently Asked
Questions which pre-date that by some years, I'd be surprised if that
really was the first time the acronym was used. Quite possible though.

The Wikipedia article doesn't say anything about people attempting to
stem the tide in the supposed change of meaning - where do you get that
from?

> A web search for "frequently answered questions"
> turns up a myriad of sites where the list of frequently
> answered questions is titled "Frequently Answered Questions."


A vastly smaller myriad than that turned up by searching for "frequently
asked questions", neither of which points has any relevance to the
question of which term was the originally intended by the FAQ abbreviation.
 
Reply With Quote
 
Joe Pfeiffer
Guest
Posts: n/a
 
      06-29-2011
"J. J. Farrell" <(E-Mail Removed)> writes:

> Michael Press wrote:
>> In article <iubgdq$meo$(E-Mail Removed)>,
>> "J. J. Farrell" <(E-Mail Removed)> wrote:
>>> Michael Press wrote:
>>>> Originally FAQ stood for frequently answered questions.
>>>> Most people do not seem to know that, even more than I thought
>>>> going in. During the transition, some people
>>>> attempted to stem the tide.
>>> Evidence please. I've known it to be an abbreviation of "Frequently
>>> Asked Questions" for several decades, this is the first time I've
>>> seen a suggestion that it is "Frequently Answered Questions".

>>
>> The Wikipedia article on FAQ documents this usage.

>
> Not quite - it claims "Originally the term FAQ referred to the
> Frequently Answered Question itself", but with no citation of any sort
> to support the claim, and without even identifying the claimant.
>
> Wikipedia does attribute the origin of the acronym FAQ to Eugene Maya
> on the SPACE mailing list, and http://www.islandone.org/SpaceDigest/
> confirms that Maya originally used the term to mean Frequently
> Answered Questions. Since there are records of the term Frequently
> Asked Questions which pre-date that by some years, I'd be surprised if
> that really was the first time the acronym was used. Quite possible
> though.
>
> The Wikipedia article doesn't say anything about people attempting to
> stem the tide in the supposed change of meaning - where do you get
> that from?


<snip>

Now, *this* is how one attacks a wikipedia article: not by making a
blanket "wikipedia is unreliable" statment, but by pointing to flaws in
the article's attributions, by pointing out that the article doesn't
quite say what was claimed, and by pointing to better evidence from
elsewhere.

In other words, the way any other argument should be attacked.
 
Reply With Quote
 
DDD
Guest
Posts: n/a
 
      06-29-2011
On Jun 25, 4:41*am, Billy Mays <(E-Mail Removed)> wrote:
> In the case where you know that your program will be terminating after
> it is done using the pointers, should you even bother freeing the space up?
>
> Example:
> int main(void)
> {
> * * *int i, * data;
> * * *data = malloc(sizeof(int) * 100);
> * * *if(data) {
> * * * * *for(i = 0; i < 100; i++) {
> * * * * * * *data[i] = i'
> * * * * *}
> * * *}
> * * */* free(data) ? */
> * * *return 0;
>
> }
>
> --
> Bill


In common, you malloc, then you free.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      06-29-2011
Michael Press <(E-Mail Removed)> writes:
> In article <(E-Mail Removed)>,
> Keith Thompson <(E-Mail Removed)> wrote:
>> James Kuyper <(E-Mail Removed)> writes:
>> > On 06/25/2011 06:44 PM, Keith Thompson wrote:
>> >> Michael Press <(E-Mail Removed)> writes:
>> >>> In article <iu3d2t$qlh$(E-Mail Removed)>,
>> >>> Eric Sosman <(E-Mail Removed)> wrote:
>> > ...
>> >>>> This is Question 7.24 on the comp.lang.c Frequently Asked
>> >>>> Questions (FAQ) page at <http://www.c-faq.com/>.
>> >>>
>> >>> FAQ was once frequently answered questions.
>> >>
>> >> Um, it still is.
>> >
>> > I presume that he's commenting on the difference between "Asked" and
>> > "Answered".

>>
>> I must admit I didn't notice that he changed the word from "asked" to
>> "answered".
>>
>> Now that I've noticed, I'm not sure I've ever seen FAQ expanded
>> to "Frequently Answered Questions" rather than "Frequently Asked
>> Questions", and I still have no idea what Michael is getting at.
>> Is he suggesting that Eric should have done something other than
>> cite the FAQ?
>>
>> Sorry if I'm being dense.

>
> Originally FAQ stood for frequently answered questions.
> Most people do not seem to know that, even more than
> I thought going in. During the transition, some people
> attempted to stem the tide.


Ok, I understand that you're saying that "FAQ" originally stood for
"Frequently Answered Questions". It's not clear whether that's
accurate or not. But whether you're right about that or not,
exactly what point were you trying to make? Does it really matter
whether the 'A' stands for "Asked" or "Answered"?

Eric replied to a question by citing <http://www.c-faq.com/>.
The context implied to me that you were criticizing what Eric did.
Was that your intent? If so, what should he have done? Or was
your point entirely about what the 'A' stands for?

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Michael Press
Guest
Posts: n/a
 
      06-30-2011
In article <iucgvd$c8f$(E-Mail Removed)>,
James Kuyper <(E-Mail Removed)> wrote:

> On 06/27/2011 03:59 PM, Michael Press wrote:
> ...
> > Originally FAQ stood for frequently answered questions.
> > Most people do not seem to know that, even more than
> > I thought going in. During the transition, some people
> > attempted to stem the tide.

>
> According to Google Groups, the oldest usenet message containing
> "Frequently Answered Questions" was dated 1989-03-22. It could only find
> 14 such messages between then and 1991-01-1.
>
> The oldest message it reports containing the phrase "Frequently Asked
> Questions" dates back to 1981-07-13, and there are 11,200 such messages
> between then and 1984-01-01. The very first such message connects that
> phrase to the acronym "FAQ", contradicting the chronology given for the
> birth of that acronym in Wikipedia's entry for "FAQ".
>
> Google Groups' query engine is extremely flaky, but these numbers and
> dates are at least suggestive of a different history than the one you
> describe.


Yes, so they are.

--
Michael Press
 
Reply With Quote
 
Jed
Guest
Posts: n/a
 
      08-10-2011

"Billy Mays" <(E-Mail Removed)> wrote in message
news:iu2sov$3dv$(E-Mail Removed)...

>"Should you free your pointers?"


Yes, because, then at least pointers, will be free.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
don't like, so don't waste your time thinking and buy them. You know,if you don't like one thing, it means nothing for you.</p> fashion t shirts seller Cisco 0 06-13-2011 02:01 AM
Free SEO -Free dictionary list -Add a link to your website for free george HTML 0 08-29-2008 04:55 PM



Advertisments