ok so this is the part of the code which is not working for me
Tally is a vector containing integers and I only want to count the number of time the integers in tally repeats themselves..but this part of the code is not working can someone help me? thanks in advance!!!
cout<<endl<<endl<<"We will now find out how many times values are repeated in your list."<<endl<<endl;
for (i=0;i<Numberofpossiblenum;i++)
{
for (j=0;j<Numberofpossiblenum-1;j++)
{
if(Tally[i] = Tally[j])
{
counter+=1;
Firstly, please enclose your code in code tags. It will make it much easier for us to read.
Secondly, the line:
if(Tally[i] = Tally[j])
uses a single equals sign. This causes the value of Tally[j] to be assigned to Tally[i], after which they will both be equal. This means that the if statement will always be true.
Presumably, you meant to use a double equals sign to check whether they are equal? I'm surprised your compiler didn't warn you about this - most modern ones do.
Thirdly, you're erasing members of your vector while in the middle of iterating over it. This will mean that its size will shrink while you're looping. You don't show us how you're calculating Numberofpossiblenum, but it's possible that it will be bigger than the number of elements in your shortened vector, which will cause errors.