Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sdfsdfs
using System; public struct Point { public Point(byte tag, double x, double y) => (Tag, X, Y) = (tag, x, y); public byte Tag { get; } public double X { get; } public double Y { get; } } public class SizeOfOperator { public static void Main() { Console.WriteLine(sizeof(byte)); // output: 1 Console.WriteLine(sizeof(double)); // output: 8 DisplaySizeOf<Point>(); // output: Size of Point is 24 DisplaySizeOf<decimal>(); // output: Size of System.Decimal is 16 unsafe { Console.WriteLine(sizeof(Point*)); // output: 8 } } static unsafe void DisplaySizeOf<T>() where T : unmanaged { Console.WriteLine($"Size of {typeof(T)} is {sizeof(T)}"); } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
my first
12
Dependencia de datos
ParseIpRanges invalid character in string
sdgdfhfh
Problem Name: single_digit
a
Easy prgm
sortowanie ( jaka )? wybor? confirm it!
Shifting Elements Forward in a List, and Random Numbers Generation
Please log in to post a comment.