- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of sizeof Operator in C#?
The sizeof() datatype returns the size of a data type. Let’s say you need to find the size of int datatype −
sizeof(int);
For double datatype −
sizeof(double);
Let us see the complete example to find the size of various datatypes −
Example
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(); } } }
Output
The size of long is 8 The size of double is 8
- Related Articles
- What is sizeof operator in C++?
- Sizeof operator in C
- Result of sizeof operator using C++
- Why is sizeof() implemented as an operator in C++?
- Implement your own sizeof operator using C++
- How to use sizeof() operator to find the size of a data type or a variable in C#
- What is the use of scope resolution operator in C++?
- What is the use of RLIKE operator in MySQL?
- What is the use of tilde operator (~) in R?
- What is the use of SOUNDS LIKE operator in MySQL?
- Why is not sizeof for a struct equal to the sum of sizeof of each member in C/C++?
- What is the use of MySQL NOT LIKE operator?
- What is the use of MySQL SOUNDS LIKE operator?
- What is the use of MySQL IS and IS NOT operator?
- How to use ‘is’ operator in C#?

Advertisements