sizeof() 데이터 유형은 데이터 유형의 크기를 반환합니다. int 데이터 유형의 크기를 찾아야 한다고 가정해 봅시다 -
sizeof(int);
이중 데이터 유형의 경우 -
sizeof(double);
다양한 데이터 유형의 크기를 찾기 위한 전체 예를 살펴보겠습니다. −
예
using System;
namespace Demo {
class Program {
static void Main(string[] args) {
Console.WriteLine("The size of long is {0}", sizeof(long));
Console.WriteLine("The size of double is {0}", sizeof(double));
Console.ReadLine();
}
}
} 출력
The size of long is 8 The size of double is 8