Witam,
mam problem z wylosowaniem 10 znaków (najlepiej A-Z i a-z oraz liczby).
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <conio.h>
#include <string>
using namespace std;
///////////////////////////////////////////////////////////////////////////
struct person
{
string imie;
string nazwisko;
string e_mail;
string id;//czy tu użyć lepiej typu char i w tablicy 10-elementowej
};
///////////////////////////////////////////////////////////////////////////
int main()
{
srand( time(NULL));
person osoba;
///////////////////////////////////////////////////////////////////////////
cout << "Podaj swoje imie: ";
cin >> osoba.imie;
cout << "Podaj swoje nazwisko: ";
cin >> osoba.nazwisko;
cout <<"Podaj e-mail: ";
cin >>osoba.e_mail;
cout << endl;
///////////////////////////////////////////////////////////////////////////
osoba.id=(rand ()%10000)+1;//nie mam pewności czy to jest prawidłowe
///////////////////////////////////////////////////////////////////////////
cout << "Imie: "<< osoba.imie<<endl;
cout << "Nazwisko: "<< osoba.nazwisko<<endl;
cout << "E-mail: "<< osoba.e_mail<<endl;
cout << "Twoj prywatny kod identyfikacyjny: "<<osoba.id<<endl;
getch();
return 0;
}