How can I declare a letter into a vector of chars?

May 12, 2012 at 9:41pm
ie.
1
2
3
4
5
6
7
8
9
int count;
vector<char> myVect(10); //Lets assume that the numbers 1-10 are stored in here;
for(count=0;count<10;count++)
{
    if(myVect[count]==3)
    {
    ... //What code would go here to replace it with a "T";
    }
}
May 12, 2012 at 9:54pm
closed account (4z0M4iN6)
Sorry, don't understand so much about vector. In such simple cases I always used an array
May 13, 2012 at 12:28am
Please help. I need the code by 10
May 13, 2012 at 12:38am
Go look up how a vector works in the reference section; you should find the answer pretty easily.
May 13, 2012 at 12:39am
Erm...

myVect[count] = 'T' ;

?
May 13, 2012 at 1:12am
Oh my bad i was using double quotes
Topic archived. No new replies allowed.