C: Dynamic Memory Allocation (2-d Array)
Posted: Mon Dec 01, 2003 6:12 pm
Hey,
I am trying to create a program that will search for words within a crossword puzzle. Right now I am thinking that storing the crossword puzzle in a 2-d array would be the easiest to work with when searching for the words, but if I want to do that then I need to allocate memory for the array. The problem is, I don't know what the size of the crossword puzzle will be, so I would have to find that out from the user, and then allocate memory for the array. I don't know how to do this.
I am hoping someone knows how to do this, or can fill me in on a better accomplish what I am trying to do.
Thanks for any help / advice provided.
I am trying to create a program that will search for words within a crossword puzzle. Right now I am thinking that storing the crossword puzzle in a 2-d array would be the easiest to work with when searching for the words, but if I want to do that then I need to allocate memory for the array. The problem is, I don't know what the size of the crossword puzzle will be, so I would have to find that out from the user, and then allocate memory for the array. I don't know how to do this.
I am hoping someone knows how to do this, or can fill me in on a better accomplish what I am trying to do.
Thanks for any help / advice provided.