Ich brauche deine HilfeFehler beim Setzen komplizierter Argumente in Min-Funktion? Warum? (Eclipse-C++)
if(s[i]==t)
{
//I get error for this
//aSP[pos] = min((dfs(i)+pow(i-pos,2)) , aSP[pos]);
//Then I replace the above code with the following codes, and then it worked
int a = (dfs(i)+pow(i-pos,2));
int b = aSP[pos];
aSP[pos] = min(a,b);
}
Aber sie sind die gleichen richtig? Warum erhalte ich Fehler von Eclipse?
Es sagt
Beschreibung Ressourcenpfad Ortstyp Kandidaten 'Ungültige Argumente sind: const # 0 & min (konst # 0 &, Konst # 0 &)
Beschreibung Ressourcenpfad Standort Typ-Nr passende Funktion für Aufruf auf 'min (__ gnu_cxx :: __ promote_2 :: __ Typ, int &)' ColorfulRoad.h/colorfulroad-C++ Zeile 53 C/C++ Problem
und einige andere Informationen als auch, wie widersprüchlicher Typ für Parameter, Template-Argument Abzug/nicht bestanden Substitution ..