小编roy*_*esh的帖子

C#"是'类型'但是像变量一样使用"

我正在寻找以下错误的帮助:

'Practical_2.Card'是'类型',但用作'变量'

这是我的代码:

class Tester
{
    static void Main(string[] args)
    {
        Card[] hand = {
                          new Card("Spade", 3),
                          new Card("Club", 10),
                          new Card("Diamond", 11),
                          new Card("Heart", 9),
                          new Card("Diamond", 13),
                      };
        ProcessHand(hand);

    }//end of static void main

    static void ProcessHand(Card[] cards)
    {
        Console.WriteLine("{0,-10:s}: {1,-10:i}", "suit: ", Card[0]);

    }//end of static void processhand
}//end of class Tester
class Card
{
    public string suit { get; set; }
    public int facevalue { get; set; }
    public Card (string su, int fa) 
    { …
Run Code Online (Sandbox Code Playgroud)

c# arrays variables visual-studio

0
推荐指数
1
解决办法
646
查看次数

标签 统计

arrays ×1

c# ×1

variables ×1

visual-studio ×1