I want to print a random string of my Array

1

It does not let me print a random string from my list

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    srand(time(0));
    std::string word[] = {"black","metal"};
    for (int i = 0; i < 1; i++) {
        int ra = rand() % 2;
        MessageBox::Show("Random: " + word[ra]);
    }
};
    
asked by Illud Harpyja 01.01.2017 в 23:48
source

0 answers