sizeof() ডেটা টাইপ একটি ডেটা টাইপের সাইজ রিটার্ন করে। ধরুন, আপনাকে int ডেটা টাইপের সাইজ জানতে হবে:
sizeof(int);
double ডেটা টাইপের জন্য:
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