I make a program in c ++ (Windows Forms). And I need to enter a series of numbers, for example,

int x = textBox1->text; 

But I get an error.

  • @Noob Explain the question, at the moment nothing is clear. - Nicolas Chabanovsky ♦

3 answers 3

You have a text property; not a numeric type at all, but a text one. See how you can convert a test type to integer (int)

     int x = Parce.ToInt ( textBox1->text); 

    I don’t remember exactly how to use parsis. )

      If you are programming in C #, then you need

       int x = Convert.ToInt32(textBox1.text); 

      and if C ++, then

       int x = Int32::Parse(textBox1->text); 
      • Convert.ToInt32 and Int32.Parse are built into the framework and are available for both C # and C ++. - nitrocaster