c++ random changing consol name help

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üye
Katılım
23 Eki 2020
Mesajlar
1
Tepki puanı
0
Yaş
26
5 HİZMET YILI
Hello, can someone help me, I want the c ++ console name and exe name to change when opened and closed.Please

C++:
#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
}
 
Üye
Katılım
23 Eyl 2020
Mesajlar
36
Tepki puanı
27
5 HİZMET YILI
C++:
std::string random_string( const int len ) {
    const std::string alpha_numeric( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890" );
 
    std::default_random_engine generator{ std::random_device{}( ) };
    const std::uniform_int_distribution< std::string::size_type > distribution{ 0, alpha_numeric.size( ) - 1 };
 
    std::string str( len, 0 );
    for ( auto &it : str ) {
        it = alpha_numeric[ distribution( generator ) ];
    }
 
    return str;
}

C++:
SetConsoleTitle( random_string( length_of_string ).c_str( ) );
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst