//help please, i just want the program to tell me
// if there is a repeated # on the string
// is always true or false
#include <iostream>
using namespace std;

const int ARRAY_SIZE = 5;

bool valid2(const int list1[]);
void fillArray(int list1[], int ARRAY_SIZE);
void printArray(const int list1[], int ARRAY_SIZE );

int main()
{   
int list1[ARRAY_SIZE];
  bool found;


cout << "enter a number" << endl;

     fillArray(list1, ARRAY_SIZE);

    printArray(list1, ARRAY_SIZE);
     cout << endl;

      valid2(list1);

  if (!found)
  cout << "repeat number" <<endl;
  else 
  cout << " " <<endl;
  system("pause");
} 

bool valid2(const int list1[])
{
     int tmp;
     for(int i=0;i<ARRAY_SIZE;i++)
     {
             tmp=list1[i];
             for(int j=0;j<ARRAY_SIZE;j++)
             {
                if(list1[j]==tmp && (j>i))
                  {
                  return false;
                  }
             }
     }
     return true;

}

void fillArray(int list1[], int ARRAY_SIZE )
{
     int index;
     for (index = 1; index < ARRAY_SIZE; index++)
         cin >> list1[index];
}

void printArray(const int list1[], int ARRAY_SIZE )
{
     int index;
     for (index = 1; index < ARRAY_SIZE; index++)
         cout << list1[index];
}
Salem commented: posts >= 10 && !usesCodeTags => -ve rep -3

I think i already pointed out the use of code tags in one of your posts. Please read this link

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.