Hi.
I'm using large arrays with pointers.
Now I'm getting the message of to large array in
my programme , and I'm ""told"" to use "FAR".
I wonder is it possible to "reset" the pointers
and arrays "in" the programme, and use them
again to do "other" calculations.
In that way I'm thinking of "saving...?" memory.
Is it possible or complelely wrong...?
I'm in the need of very large arrays with "very fast"
calculations.
Thanks in advance.
peter
Comments
: Now I'm getting the message of to large array in
: my programme , and I'm ""told"" to use "FAR".
: I wonder is it possible to "reset" the pointers
: and arrays "in" the programme, and use them
: again to do "other" calculations.
: In that way I'm thinking of "saving...?" memory.
: Is it possible or complelely wrong...?
You can always assign anything you want to an array. You CAN, as an example, create an array in your main() routine, pass it (by pointer) to all your functions, and fill it in with different data in each function. As long as your aware that each function must initialize the array each time it is called in this scenario. This may or may not be a good approach, depending on the details of the program, but you get the idea.
It sounds like your array is too large though (you must in a 16 bit world
Creating far arrays will allow you to access more memory, but still pretty much limited to 64K for each array.
One more note, just because it scares me to hear you say reset pointers and arrays. I'm probably misinterpreting you here, but just in case I'll mention this anyway. You can set a pointer to point to anything, anytime. Arrays, which although they are pointers to memory, can't (should never) be set to point to anything else. If it is a stack array, don't ever reassign the pointer. If it is a dynamic array, don't reassign the pointer until you free the memory first.
Rock