Исходник:
void MainWindow::Search()
{
node* Active = NewTree.Delete(ui->textEdit->toPlainText().toInt(), &NewTree.Tree);
myPicture->DrawEl(Active->Key, Active->X, Active->Y, bool color);
}
Структура:
struct node
{
int Key;
int Count;
node *Left;
node *Right;
int X, Y;
};
Ошибки:
/laba2/mainwindow.cpp:73: ошибка: cannot initialize a variable of type 'node*' with an rvalue of type 'int' divv* Active = NewTree.Delete(ui->textEdit->toPlainText().toInt(), &NewTree.Tree);
/laba2/mainwindow.cpp:74: ошибка: expected '(' for function-style cast or type construction myPicture->DrawEl(Active->Key, Active->X, Active->Y, bool color);
int TREE::Delete (int el, node **w)
{
node** tempAdr = NULL;
node* tempVal = NULL;
tempAdr = &*w;
tempVal = *w;
if (w==NULL)
{// Вершины в дереве нет;
cout << "Такой вершины нет";
return -1; }
else
{
if (el<(**w).Key)
{
Delete (el, &((**w).Left));
return 1;
}
else
{
if (el>(**w).Key)
{
Delete (el,&((**w).Right));
return 1;
}
}
}
if (tempVal->Right == NULL)
*tempAdr = tempVal->Left;
else
{ node *y = tempVal->Right;
if (y ->Left == NULL)
{
y->Left = tempVal->Left;
*tempAdr = y;
}
else
{
node *x = y->Left;
while (x->Left != NULL)
{
y=x;
x=y->Left;
}
y->Left = x->Right;
x->Left = tempVal->Left;
x->Right = tempVal->Right;
*tempAdr = x;
}
}
return 1;
}
Ругается постоянно, всё перепробовал
Оборудование для ресторана: новинки профессиональной кухонной техники
Частный дом престарелых в Киеве: комфорт, забота и профессиональный уход
Всем привет, дошел до темы указателей, честно говоря, тема неприятная, поэтому сразу к вам вопросы, товарищи
Использую библиотеку dwrite для рендера текста в Direct2DТекст хорошо рисуется, проблем никаких нет
Можно ли подключить в Qt creatorh файлы,написанные на c++ в vs2015,и использовать их функционал?