#include <iostream>
#include <cstdlib>
#include <ctime>
#include <stdio.h>
#pragma warning(disable : 4996)
std::string randomGen(int len)
{
char c1[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
std::string temp;
temp.reserve(len);
for (int i = 0; i < len; ++i)
{
temp += c1[rand() % (sizeof(c1) - 1)];
}
return temp;
}
int main()
{
srand(time(0));
FILE* dosya = fopen("log.txt", "w");
auto test = randomGen(5);
std::cout << test << std::endl;
fprintf(dosya, test.c_str());
fclose(dosya);
system("pause");
return 0;
}