|
-
May 14th, 2009, 05:37 AM
#1
how to make an int array? *basic question
hi, i want to use things like:
int in;
in[1] = 1;
in[2] = 1;
in[4] = 6;
in [i] = i;
so later i can check things like:
if(in[i] == 1){
do things();
}
else if(in[i] == 2){
do things2();
}
what type of thingy do i need to create for this?
i tried char in[200]; but it allways said in[i] == 1 for any value O_o
Last edited by Owyn; May 14th, 2009 at 05:44 AM.
-
May 14th, 2009, 05:51 AM
#2
Re: how to make an int array? *basic question
instead of "char in[200]", use "int in[200]"
-
May 14th, 2009, 05:54 AM
#3
Re: how to make an int array? *basic question
just tried int in[200]; but it says in every [] i have 1 =\ that means that i either write to [] wrong or read from [] wrong nothing else?
-
May 14th, 2009, 06:01 AM
#4
Re: how to make an int array? *basic question
If you write "int in[200]", then all the values in the array should be initially set to zero.
Can you paste your code so I can get a better idea of what you are trying to do.
-
May 14th, 2009, 06:07 AM
#5
Re: how to make an int array? *basic question
figured out already default case was run after others and replaced all values with 1 =\ thx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|