형변환1 [C#] 타입캐스트 TypeCasting (Convert class) using System; namespace MyFirstProgram { internal class Program { static void Main(string[] args) // main method { double x = 3.14; int x_2 = Convert.ToInt32(x); Console.WriteLine(x.GetType()); Console.WriteLine(x_2.GetType()); double d = Convert.ToDouble(x_2) + 0.14; Console.WriteLine(d.GetType()); // int e = 321; double e = 312.123; String f = Convert.ToString(e); Console.WriteLine(f.GetType().. 2023. 2. 25. 이전 1 다음 728x90