![]() |
|
#1
|
|||
|
|||
array sizepls help!!
Take for example, u have a count of 10 number. how can this count be declared as the array size is it CPP / C++ / C Code:
i am trying to make the size more dynamic |
|
#2
|
|||
|
|||
|
Quote:
Either you can do #define count 10 or #define size 10 and then int arr[count] or int array[size] or in c++ you can do const int size = 10 then, int array[size] but you can't do any of this dynamically, for example cout<<"enter size"; cin>>size; int arr[size]; //error for dynamic storage, u'd have to use linked lists or some other pointer based data structure. |
|
#3
|
||||
|
||||
|
Machinated is correct. You can't define an array to be dynamic. However, you can define a dynamic structure and still address it like an array.
For example: CPP / C++ / C Code:
HTH, d |
|
#4
|
||||
|
||||
|
this is dynamic array,
it can automatic change the array size when your input data is more than your array size i present it using class in C++ form CPP / C++ / C Code:
Last edited by dsmith : 01-May-2004 at 07:08.
Reason: Please use [c] & [/c] for syntax highlighting
|
Recent GIDBlog
Developing GUIs with wxPython (Part 4) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Having a problem | Chuckles | Computer Hardware Forum | 19 | 13-Sep-2004 12:17 |
| Speed up C++ code about 3d array! | Truong Son | C++ Forum | 0 | 16-Mar-2004 21:52 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 09-Mar-2004 23:56 |
| c: array comparison | jack | C Programming Language | 7 | 26-Jan-2004 11:21 |
| Extra null element in an array | samtediou | MySQL / PHP Forum | 2 | 11-Dec-2003 11:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The