program shutting down

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 for(int i=0;i<(length);i++)
     {
             v=string(1,file.at(i));
             cout<<"v is "<<v<<endl;
             if(v==SPADES||v==HEARTS||v==DIAMONDS||v==CLUBS)
             {
                   suit[suit_count]=file.at(i);
                   cout<<"suit is"<<suit[suit_count]<<endl;
                   suit_count++;
                   
             }
             else if((v==KING)||(v==QUEEN)||(v==JACK)||(v==ACE)||(v==TEN)||(v==NINE)||
                     (v==EIGHT)||(v==SEVEN)||(v==SIX)||(v==FIVE)||(v==FOUR)||(v==THREE)||
                     (v==TWO))
             {
                 value[value_count]=file.at(i);
                 cout<<"value is "<<value[value_count]<<endl;
                 value_count++;
             }


whenever the value count incrementing is added to the program it causes the program to shut down but when i comment that one line out the program runs without problems.
Can you show us the definitions of value and value_count?
i had the value set as a string thats what was causing it thanks anyway
Topic archived. No new replies allowed.