标题:csc 编译时的错误!
只看楼主
lanyong_he
Rank: 1
等 级:新手上路
帖 子:211
专家分:0
注 册:2006-7-12
 问题点数:0 回复次数:2 
csc 编译时的错误!

我很菜啊,编译下面代码时出错了,帮忙看看啊!
先谢谢了!

using System; // Namespace Declaration
class OutputClass // helper class
{
string myString;
public OutputClass(string inputString) // Constructor构造器
{
myString = inputString;
}
public void printString() // Instance实例 Method
{
Console.WriteLine("{0}", myString);
}
~OutputClass() // Destructor
{
} // Some resource cleanup routines
}

class ExampleClass // Program start class
{
public static void Main() // Main begins program execution.
{
OutputClass outCl = new OutputClass("This is printed by the output class.") {} // Instance of OutputClass
outCl.printString(); // Call Output class' method
}
}

错误提示是:classes.cs(22,80): error CS1002: ; expected

搜索更多相关主题的帖子: csc 编译 myString OutputClass string 
2006-07-13 12:51
chenjin145
Rank: 1
等 级:禁止访问
帖 子:3922
专家分:0
注 册:2006-7-12
得分:0 

花國號亂七八糟


[url=javascript:alert(1);] [div]fdgfdgfdg\" on\"[/div] [/url]
2006-07-13 13:48
lanyong_he
Rank: 1
等 级:新手上路
帖 子:211
专家分:0
注 册:2006-7-12
得分:0 
应该怎么调整一下啊,我把OutputClass outCl = new OutputClass("This is printed by the output class.") {}  后面这俩花括号去掉了就能够正常输出了!

http://blog./lanyong_he@126/
2006-07-13 14:46



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




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

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