After looking up the List command, I understood that I should go like this:
1 2 3 4 5
|
List<int> iList = new List<int>()
for ( int i = 0, i < 92, i ++ ) {
iList.Add(i) = i + 1;
}
|
Like basically creating the list and using it like I would use a normal Array in console programming ?
I shall try this, thank you for your time and reply :)
Edit: Also, for example iList[0]; could be used as a normal int, right? Just making sure :D
Well it seems it won't let me use it, as this is what I've got:
1 2 3
|
1>c:\users\breaker\documents\visual studio 2010\projects\damagecalculator\damagecalculator\Form1.h(68): error C2143: syntax error : missing ';' before '<'
1>c:\users\breaker\documents\visual studio 2010\projects\damagecalculator\damagecalculator\Form1.h(68): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\breaker\documents\visual studio 2010\projects\damagecalculator\damagecalculator\Form1.h(68): error C2238: unexpected token(s) preceding ';'
|
The lines are
1 2
|
int iLevel;
List<int> iHealth = new List<int>();
|
I know these may be stupid questions, but I am fairly new to this, and I appreciate any help I can get :D
After adding
|
using namespace System::Collections::Generic;
|
I got rid of those, now I got:
|
1>c:\users\breaker\documents\visual studio 2010\projects\damagecalculator\damagecalculator\Form1.h(68): error C3845: 'DamageCalculator::Form1::iHealth': only static data members can be initialized inside a ref class or value type
|
Edit: Solved that too using
|
static int iHealth = new List<int>();
|