In c one can allocate memory for multi-dimensional arrays using malloc. Here is a sample code which one can use for initiating 2d arrays. This is useful in dynamic memory allocation for matrices #include "stdio.h"; You can access the above arrays same as you access a 2 dimensional array. |
Sunday, December 7, 2008
Dynamic Memory Allocation of Arrays in C
Posted by Basis-Consultant at 10:48 PM
Labels: c, dyanmic allocation, multi dimensional arrays
Subscribe to:
Post Comments (Atom)



0 comments:
Post a Comment