how to close or recycle "FILE f_ptr" after using it
-
how to close or recycle FILE f_ptr after using it. e.g. FILE *f_ptr1 if((f_ptr1 = fopen(textFileName,"w")) == NULL) { ...} .... And how to recycle a array after use it within a program. double data[10000]; ....using it and finish use it how to close or destroy it so reserve the memory
-
how to close or recycle FILE f_ptr after using it. e.g. FILE *f_ptr1 if((f_ptr1 = fopen(textFileName,"w")) == NULL) { ...} .... And how to recycle a array after use it within a program. double data[10000]; ....using it and finish use it how to close or destroy it so reserve the memory
mrby123 wrote:
how to close...
How about
fclose()
?mrby123 wrote:
double data[10000]; ....using it and finish use it how to...destroy it
It's on the stack. What's to destroy?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
mrby123 wrote:
how to close...
How about
fclose()
?mrby123 wrote:
double data[10000]; ....using it and finish use it how to...destroy it
It's on the stack. What's to destroy?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
fclose90 works, thanks! I mean in the heap? -- modified at 13:32 Thursday 13th April, 2006
mrby123 wrote:
I mean in the heap?
mrby123 wrote:
double data[10000];
Memory for
data
has not been allocated on the heap. The only way to free it up is to close the application.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
mrby123 wrote:
I mean in the heap?
mrby123 wrote:
double data[10000];
Memory for
data
has not been allocated on the heap. The only way to free it up is to close the application.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
DavidCrow wrote:
The only way to free it up is to close the application.
Depends. If array data is global then yes.
mkuhac wrote:
If array data is global...
As opposed to what?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb