6 Replies
jdoodle.cs(146,29): error CS0136: A local variable named
fromUnit' cannot be declared in this scope because it would give a different meaning to
fromUnit', which is already used in a parent or current' scope to denote something else
jdoodle.cs(154,29): error CS0136: A local variable named
toUnit' cannot be declared in this scope because it would give a different meaning to toUnit', which is already used in a
parent or current' scope to denote something else
jdoodle.cs(158,32): error CS0136: A local variable named value' cannot be declared in this scope because it would give a different meaning to
value', which is already used in a parent or current' scope to denote something else
jdoodle.cs(218,29): error CS0136: A local variable named
fromUnit' cannot be declared in this scope because it would give a different meaning to `fromUnit', which is already
its not workingyour issue is that
else if (choice == 5)
is inside else if (choice == 4)
you need to add another brace on line 138u cant define a variable of the same name twice in the same scope
u can atleast reassign a value to it without redefining it
Thanks for helping me fix the code
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.