IceSkull[BE]
Legacy Member
bij het compilen van deze code krijg ik deze fout:
Error 1 Use of unassigned local variable 'output' C:\Documents and Settings\USER\Mijn documenten\Visual Studio 2005\Projects\ElectricsSimulation\ElectricsSimulation\Program.cs 33 13 ElectricsSimulation
de code:
wat is het probleem hier, ik heb al vanalles geprobeerd..
Error 1 Use of unassigned local variable 'output' C:\Documents and Settings\USER\Mijn documenten\Visual Studio 2005\Projects\ElectricsSimulation\ElectricsSimulation\Program.cs 33 13 ElectricsSimulation
de code:
Code:
class resistance
{
public float value = 0; // waarde in ohm
public float tolerance = 0; // tolerantie in %
public static resistance operator +(resistance lhs, resistance rhs)
{
resistance output;
output.value = lhs.value + rhs.value;
return output;
}
}
en wat verder.... in main()
resistance weerstandA = new resistance();
resistance weerstandB = new resistance();
resistance totaleweerstand = weerstandA + weerstandB;
wat is het probleem hier, ik heb al vanalles geprobeerd..
