I wrote the code, but it displays the following error:
C:\Works\contr_glsso1\mainwindow.cpp:771: ошибка: C2664: 'Line_Graph::Set_Data' : cannot convert parameter 2 from 'PTYPE *' to 'double *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast I do not know what to do. ; _;
defines.h
typedef float PTYPE; struct.h
PTYPE *RE; mainwindows.h
void Update_Line(double X); mainwindows.cpp
void MainWindow::Update_Line(prof->RE) // вот тут вот он выдает ошибку Tried to lead to type failed:
void MainWindow::Update_Line((unsigned double *)prof->RE) // выдает ошибку C2664 Here is another option:
void MainWindow::Update_Line(*prof->RE) // выдает C2100: illegal indirection And further:
double f1 = *prof->RE; void MainWindow::Update_Line(f1) // ошибка: C2109: subscript requires array or pointer type Even so I tried:
double f1 = *prof->RE; void MainWindow::Update_Line(f1) // ошибка: C2109: subscript requires array or pointer type I can’t convert a PTYPE into a double, I can’t give up a variable - I use it a lot where I use it. The code is not mine, just ran into a problem.
Update_Lineexpects a floating point number. And you give him a pointer to some mysteriousPTYPE. - yrHeTaTeJlbPTYPEannouncement. In general, with such a question, even if you are told how to make the code compile , it is not a fact that it will work . For example, you can simply writeUpdate_Line(0.0);:) - HarryUpdate_Line(*prof->RE)? - jfs