floatToStr(c); StrToInt(c); writeln(c); 

The compiler points to the second line and produces: you cannot convert the type real to string I need to convert real to integer , and с the beginning it has type real

  • Apparently you have a c - has a real type. The second function accepts a string - and what do you pass on to it? ... - Harry

1 answer 1

To translate real into Integer, you can use the Round function (also see Floor, Ceil )

By the way, floatToStr and StrToInt are functions, they return a result, and do not change the argument.