-1
我有下面的代碼有問題:錯誤無效的轉換(-fpermissive)C++
void dodaj(BST * T)
{
T->iloscwezlow();
int i,n;
wezelbst * x;
cin >> n;
for(i = 0; i < n; i++)
{
x=static_cast<int>(rand()%10);
T->wstaw(x);
}
cout << endl;
T->walk(T->korzen);
T->iloscwezlow();
}
這裏是我的問題:
In function 'void dodaj(BST*)':
[Error] invalid conversion from 'int' to 'wezelbst*' [-fpermissive]
歡迎來到SO,你應該用英語發佈代碼。 –
@StephaneRolland錯誤的行是英文。你應該問問'wezelbst'是如何定義的。 – Njol
@Njol確定錯誤的行是x = static_cast(rand()%10);.但是,在SO上發佈的代碼應該是英文的。 –