[C#] "FormatException" 에러 해결


[C#]

이 글에서는 C# 개발 과정에서 발생할 수 있는 FormatException 에러에 대해 설명하고, 실무 코드 예제를 통해 원인 분석 및 해결 방법을 제시합니다. 문제상황 (에러가 발생한 코드) using System; namespace FormatExceptionExample { class Program { static void Main(string[] args) { string userInput = "1234.56"; int convertedNumber = int.Parse(userInput); Console.WriteLine("Converted number: " + convertedNumber); } } } 위 코드에서는 사용자로부터 입력받은 문자열을 정수로 변환하려고 시도합니다. 이때, 문자열이 ..


원문링크 : [C#] "FormatException" 에러 해결