Array kind of stops (?) at value of 10. help

input for the following code:
1
10
1 1 1 1 1 1 1 1 1 10

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  #include <iostream>
using namespace std;
int main(){
    int T, N, i=0, j=0, A[i], S[j];

    cout<<"###### R-Boy's party ######"<<endl;

    do{
        cout<<"Enter the amount of test cases to do (between 1 and 1.000)\n";
        cin>>T;
        if(T<1 or T>1000)
          cout<<"Invalid number! Enter a number between 0 and 1.000\n";
    }while(T<1 or T>1000);

    for(j=0; j<T; j++){
    	system("CLS");
    	cout<<"case #"<<j+1<<endl<<endl;
		S[j]=0;
        do{
        cout<<"enter the number of R-Boy's friends (between 1 and 1.000)\n";
        cin>>N;
        if(N<1 or N>1000)
            cout<<"Invalid number! Enter a number between 0 and 1.000\n";
        }while(N<1 or N>1000);
    

        cout<<"\nenter the number of the "<<N<<" R-boy's friends degree of friendship (between -1.000 and 1.000)\n";
       
        for(i=0; i<N; i++){
        	
        	do{
            cin>>A[i];
            if(A[i]<-1000 or A[i]>1000)
                cout<<"Invalid number! Enter a number between -1.000 and 1.000\n";
        }while(A[i]<-1000 or A[i]>1000);
        
            if(A[i]>0)
                S[j]+=A[i];
        }

    }
    system("CLS");
    for(i=0; i<T; i++){
        cout<<"case #"<<i+1<<": "<<S[i]<<endl;
    }
    return 0;
}

the program can't recognize the 10th value, "10" in this case. please help
Last edited on
What is the size of A and S?
Well, line 4 is illegal and, even if it weren't, there wouldn't be many elements in arrays A[] and S[] ...
Topic archived. No new replies allowed.