[Dev-C++] #DEFINE versus cont variables in array inicializations
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <and...@su...> - 2003-05-29 13:08:54
|
Dear Users, For the sake of flexibility, I think we only have two ways to iniciatize a size of an array: 1) via #define: #define MAX 10 ... int vect[MAX]; ... 2) via cont variable: const int size=10; ... int vetc[size]; ... So, in both ways, everytime if I need to change the size of the arrays, it´s only necessary to change 10 to the other value. -->My questions: 1) Is there more ways to to this? 2) For theese two ways presented here, when use one and when use the other? Explaining a little more what I need to know: in a "good programming technique" point of view, what of theese two is the preferred of the programmers (please don´t answer "pointers" ...lol). Regards André |