并非所有的代码路径都返回值??雅
public class b
{
public char connection(char[] str1,char[] str2)
{
int i;
for( i=0;i<str1.Length;i++)
{
Console.WriteLine("str1[{0}]:{1}",i,str1[i]);
}
for(int j=i+1;j<str1.Length+str2.Length;j++)
{
return(str2[j]);
}
}
public static void Main()
{ char[] x=new char[20];
char[] y=new char[15];
Console.WriteLine("please input character x:");
for(int i=0;i<20;i++)
x[i]=Convert.ToChar(Console.ReadLine());
for(int i=0;i<20;i++)
Console.WriteLine("x[{0}]:{1}",i,x[i]);
Console.WriteLine("please input character y:");
for(int j=0;j<15;j++)
{
y[j]=Convert.ToChar(Console.ReadLine());
b myb=new b();
char k=myb.connection(x,y);
Console.WriteLine("y[{0}]:{1}",j,y[j]);
}
}
c:\inetpub\wwwroot\c\b.cs(10): “c.b.connection(char[], char[])” : 并非所有的代码路径都返回值
public char connection(char[] str1,char[] str2)
谢谢