C#
c# 변수 Type 구하기
자유프로그램
2015. 6. 16. 14:48
반응형
c# 변수 Type 구하기 - GetType()
환경 : windows 7 64bit, visual studio 2013 community
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace typetest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int a = 33; | |
string bb = "abc"; | |
var cc = "test"; | |
Console.WriteLine(a.GetType()); | |
Console.WriteLine(bb.GetType()); | |
Console.WriteLine(cc.GetType()); | |
Console.WriteLine(a.GetType().Name); | |
Console.WriteLine(bb.GetType().Name); | |
Console.WriteLine(cc.GetType().Name); | |
} | |
} | |
} |
반응형