标题:给我看看哪错了吧 用的vs2005
只看楼主
小兔子慢慢
Rank: 2
等 级:论坛游民
帖 子:45
专家分:30
注 册:2009-4-13
结帖率:100%
已结贴  问题点数:20 回复次数:3 
给我看看哪错了吧 用的vs2005
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace jiegouxing
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        struct Student
        {
            public int no;
            public string name;
            public char sex;
            public int score;
            public string Answer()
            {
                string result = "该学生的信息如下:";
                result += "\n学号:" + no;
                result += "\n姓名" + name;
                result +="\n性别"+sex;
                result += "\n成绩" + score;


            
            
            
            }
        
        
        
        
        }

        private void Form1_Load(object sender, EventArgs e)
        {Student s;
         s.no=101;
         s.name="黄海";
         s.sex='男';
        s.score=540;
            label1 .Text =s.Answer ();
            //label1 .Text +="\n\n"+Datatime.now;
        }
    }
}
jiegouxing.rar (15.76 KB)


[ 本帖最后由 小兔子慢慢 于 2011-3-8 12:51 编辑 ]
2011-03-08 11:13
小兔子慢慢
Rank: 2
等 级:论坛游民
帖 子:45
专家分:30
注 册:2009-4-13
得分:0 
我知道啦
2011-03-08 13:29
xydddaxia
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:33
帖 子:466
专家分:2307
注 册:2009-3-20
得分:20 
Answer()函数没得返回值
return result;

站在春哥的肩膀上
2011-03-08 13:29
小兔子慢慢
Rank: 2
等 级:论坛游民
帖 子:45
专家分:30
注 册:2009-4-13
得分:0 
回复 3楼 xydddaxia
加个口口号拜  交流
2011-03-08 13:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-333536-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.100439 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved