Unable to pass in pointer to function

Hi I recently wrote this function for creating an array by passing in a pointer .
whoever it does not work when i pass in 2 different pointers. Is there something wrong with the code?
void constructSet (char* a, int b)
{
for ( int i = 0 ; i <= b ; i++ )
{
if (i == b)
* ( a+i) = '\n';
else
{
bool same;
do
{
same = false;
* (a + i) = static_cast<char>(rand() % (90 -65 + 1) + 65);
if ( i != 0)
{
for (int j = i - 1 ; j>=0 && same == false ; j--)
{
if ( *(a + i) == * (a + j))
same = true;
}
}
}while (same == true);
}
}
}
Topic archived. No new replies allowed.