C#Visual Studio - 使用未分配的变量错误! [英] C# Visual Studio - Use of unassigned variable Error!

查看:68
本文介绍了C#Visual Studio - 使用未分配的变量错误!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我是C#的新手并且编程一般......我收到这个错误并且

我不知道为什么,我的意思是,变量被声明以上。

请帮助。



http://s13.postimg.org/qztdqd6fr/2313123123.png

Hi, first of all I'm new to C# And programming in general... I'm getting this error and
I don't know why, I mean, the variable is declared above.
Help please.

http://s13.postimg.org/qztdqd6fr/2313123123.png

推荐答案

没关系,以前没有收到用户输入我犯了一个错误。

weaponSelected = Console.ReadLine();

非常感谢!
Nevermind, I made a mistake by not getting the user input before.
weaponSelected = Console.ReadLine();
Thanks a lot!


这篇关于C#Visual Studio - 使用未分配的变量错误!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆