Re: use delete to destroy primitive/object types but memory is not freed

From: jimjim (FreeBSD_net_at_blueyonder.co.uk)
Date: 04/08/04


Date: Wed, 07 Apr 2004 23:04:58 GMT


> hen you're off-topic, you're off-topic. Don't argue about it, just take
the good advice you are given.

I cant understand why if I am off topic an answer exists in the C-faq. Of
course for the C equivalent of the C++ code I provided in my original post.
Take few steps back and look at the bigger picture please (Dont take it that
I am trying to be "clever" now please)

> Even if the simple substitution you propose actually worked (it doesn't)

int main(){
int *g= malloc(sizeof(int));
*g = 9;
free(g);
printf("%d %d %d %d\n",sizeof(g),sizeof(double),sizeof(*g),*g);
*g = 111;
printf("%d %d %d %d\n",sizeof(g),sizeof(double),sizeof(*g),*g);
  return 0; }

The above substitution gives me the same results. Please why dont you try to
explain to me what exactly you mean? This is a typical phainomenon in
newsgroups; people having the knowledge to answer but provide cryptic
answers. If you are not to give a clear answer to my question, its better
not to answer at all!

>there are still differences between C and C++ memory allocation, and
comp.lang.c++ is where you'll get the right >answers, reviewed by the right
people.

Can you please explain to me what is the case in C. This is again a genuine
question. I just want to learn!



Relevant Pages

  • help with those darn INT and STRING thingys!!!!!!!
    ... i just cant get this. ... noticed that a lot are on this topic, but i dont really understand what they ... but the program doesnt recognise the input ... magically use it as an int. ...
    (comp.lang.java.help)
  • Re: why do US-christians behaving like children
    ... You let THEM keep tfhe mystey as theirs, to dont understand since they ... Take the story about cain and abel- the one tied down to  the earth ... You cant miss it... ... concider the vast vast vast universe im ...
    (talk.origins)
  • why do US-christians behaving like children
    ... You let THEM keep tfhe mystey as theirs, to dont understand since they ... Take the story about cain and abel- the one tied down to the earth ... You cant miss it... ... concider the vast vast vast universe im ...
    (talk.origins)
  • why do US-christians behaving like children
    ... You let THEM keep tfhe mystey as theirs, to dont understand since they ... Take the story about cain and abel- the one tied down to the earth ... You cant miss it... ... concider the vast vast vast universe im ...
    (talk.origins)