954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

2D dynamic array within struct

Are there any ways to create a two dimensional array within a "struct" data structure?

ganesh_c
Newbie Poster
2 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

I'd try declaring the array using pointer to pointer syntax within the declaration of the struct. Then within the constructor I'd use dynamic memory to declare the memory. The dimensions could be hard coded or "user supplied". The destructor would probably release the memory declared. Assuming you are using C++ style structs, that is.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You