September 1st, 2003, 11:22 PM
Join Date: Oct 2002
Location: in the perfect world
>>Others have pointed out that you can't use a variable in an array declaration. However, variable length arrays were introduced in C99, and some compilers have permitted this as an extension for years. <<
To compile you must have a complier that is up to date or it would have generated errors.
MSVC.NET 2003 allows it if you use C (.c) files rather than C++ files (.cpp).
It is IMHO bad coding practice and should be avoided.
pArray[i]=NULL;//ensure is null.
//error check all mem allocs
//use and then free memory before functin ends
I prefer to use the WIN32 mem functions as they also tell you if they fail to free memory. A fail to free is a sign the memory has been incorrectly used.
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.