"오류 CS1513 : 예상 됨"으로 50 행에 도달하면 중단되는 작은 샘플 프로그램이 있습니다. 일반적으로 반복되는 중괄호 수를 세어보고 오류가 없음을 제외하고는 일반적입니다. 나는 another forum에 문제가 아마 키워드와 클래스 선언을 사용하는 나의 위치라고 들었지만 잘못된 것을 찾을 수 없었다.콘솔 프로젝트는 console.writeline에서는 실패하지만 console.readline에서는 실패합니다.
내가 실수를하고 있는지 알고 싶습니다. 이것은 전체 프로그램입니다. 차이가 있다면 SharpDevelop로 작성합니다.
using System;
namespace Problem
{
public class ClassA
{
public static void Main(string[] args)
{
ClassB MyObject = new ClassB();
MyObject.MethodA();
}
}
public class ClassB
{
public String str_a = "";
public String str_b = "";
public String str_c = "";
public bool bool_a = false;
public int[] int_a = new int[6];
public void MethodA()
{
while (str_a == "" || str_a == null)
{
String str_a2 = Console.ReadLine();
if (str_a2 == "" || str_a2 == null)
{
}
else
{
str_a = str_a2;
}
}
while (str_c == "")
{
String str_c2 = Console.ReadLine();
if (str_c2 == "" || str_c2 == null)
{
}
else
{
str_c = str_c2;
}
}
while (bool_a == false)
{
Console.WriteLine(""); //Fails to compile, asks for ending brackets here
for (int i = 0; i < 6; i += 1)
{
int_a[i] = 0;
}
bool_a = true;
}
}
}
}
내가 이것을 시도하고 아주 잘 작동하기 때문에 당신은 Visual Studio에서 이것을 시도 했습니까? –
아니요,하지만 내가 말했던 다른 포럼에서 해결되었습니다. 나는 이유를 아래에 게시했다. –