here was an attempt using the strcat which does not work since you cant convert an int to a character string.
Code:
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
using namespace std;
int main()
{
srand((unsigned)time(0));
int random_integer, x=0, n1, n2, n3, n4, n5, n6, n7;
char pass[7];
do
{
random_integer = (rand()%9)+1;
cout << random_integer;
x++;
if (x==1)
{
n1=random_integer;
}
if (x==2)
{
n2=random_integer;
}
if (x==3)
{
n3=random_integer;
}
if (x==4)
{
n4=random_integer;
}
if (x==5)
{
n5=random_integer;
}
if (x==6)
{
n6=random_integer;
}
if (x==7)
{
n7=random_integer;
}
}
while (x!=7);
cout << endl << n1 << n2 << n3 << n4 << n5 << n6 << n7;
strcat(pass,n1);
strcat(pass,n2);
strcat(pass,n3);
strcat(pass,n4);
strcat(pass,n5);
strcat(pass,n6);
strcat(pass,n7);
getch();
}