
August 16th, 2005, 06:18 PM
|
 |
Contributing User
|
|
Join Date: Feb 2004
Location: Middle TN
|
|
Just to expand on Dave's suggestion:
If you created the array yourself, you already know how large the array is, because you malloc'ed or new'ed the memory. If you need that information elsewhere in your program store it as a variable or a #define (depending on your design).
If you called some API call that returned a pointer to a dynamically created array, I sincerely hope it also gives you the size of the array. If it does not, either a) shoot the person who wrote the API, or b) get yourself a new API.
On second thought, you should probably do both. 
__________________
Bad code monkey! No banana!
|