john snow
john snow

Reputation: 21

Error CS1525: Unexpected symbol `?', expecting `.' in monodevelop

This is the code that give me the error:

s.GetWeight(out weightInLb, out weightInG, out weightInOz, out bool? isStable);

 Error CS1525: Unexpected symbol `?', expecting `.'

This code calls a function GetWeight, here is the code:

 public void GetWeight(out decimal? weightInLb, out decimal? weightInG, out decimal? weightInOz, out bool? isStable)

What am I doing wrong? Please help!

EDIT

If I replace the ? with a . I get the error:

Error CS0117: `bool' does not contain a definition for `isStable'

Upvotes: 0

Views: 345

Answers (1)

Alexander
Alexander

Reputation: 9632

It looks like you are trying to use out variables and it's just not supported by your compiler. So do it in old fashioned way

bool? isStable;
s.GetWeight(out weightInLb, out weightInG, out weightInOz, out isStable);

Upvotes: 1

Related Questions