![]() |
| | #1 |
| Registered User Join Date: Oct 2009
Posts: 1
| 2D array, size unknown at compile time I need to create a 2D array with size decided by the user during execution. After its size has been chosen it will not alter during execution of the program. How would I go about coding that up in a sensible way? Or, should I just approach it a different way? Thanks |
| gah_ribaldi is offline | |
| | #2 |
| Registered User Join Date: Jun 2008
Posts: 1,134
| Doesnt this work? Code: x = getX(); //get from user y= getY(); Object[,] a = new Object[x,y]; |
| C_ntua is offline | |
![]() |
| Tags |
| array, dynamic memory |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Allocating an array of unknown size? | scarlet00014 | C Programming | 2 | 09-27-2008 09:53 AM |
| Sending an email in C program | Moony | C Programming | 28 | 10-19-2006 10:42 AM |
| Class Template Trouble | pliang | C++ Programming | 4 | 04-21-2005 04:15 AM |
| Type and nontype parameters w/overloading | Mr_LJ | C++ Programming | 3 | 01-02-2004 01:01 AM |
| Something I'd like to share with all of you: simple frustum culling | Silvercord | Game Programming | 11 | 03-25-2003 05:13 PM |