Arrays in Constructors
| theChameleon (9) | |||
| Hello, i'd like to write something that fixes the size of an array inside a constructor, instead of fixing the size when declaring the array. how do i do that? i have tried...
something like that, but, after running the main prog, a window will pop up telling me that theres an unhandled runtime exception. is there a way to do wat i did, but get rid of this runtime exception thingie? thanks. do i have to catch/throw some exception, and if so, what exception and how? im pretty new to this lang, so any help would be much appreciated. | |||
| Grey Wolf (637) | |||
You could do somthing like this:
But you would be better off using a vector | |||
| Zaita (1151) | |||
"do i have to catch/throw some exception, and if so, what exception and how? im pretty new to this lang, so any help would be much appreciated."
| |||
| theChameleon (9) | |||
| thanks Grey Wolf, for your prompt reply. that really helped in getting rid of that exception thingie. a vector is not required, in my case, coz the number is fixed and not dynamic, but thanks anyway. | |||
This topic is archived - New replies not allowed.
