Y
Y
yaroslavklimuk2020-11-05 21:46:11
C++ / C#
yaroslavklimuk, 2020-11-05 21:46:11

C++ how to make variable output in MessageBox?

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    double x = 5;
    MessageBox::Show(x);
  };

Here is a simple piece of code. Beats the error "There are no instances of the overloaded function 'System::Windows::Forms::MessageBox::Show' matching the argument list".
Tell me what's wrong? Maybe I didn't connect something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2020-11-05
@yaroslavklimuk

Use Convert::ToString()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question