P
P
ProblemBook.NET
Search…
P
P
ProblemBook.NET
ProblemBook.NET
LANGS
Задачник.NET
ProblemBook.NET
Oop
Strings
Linq
Multithreading
ValueTypes
“StructLayout” (Problem)
“MutableProperty” (Solution)
“Boxing” (Solution)
“MutableProperty” (Problem)
“Boxing” (Problem)
“Enumerator” (Solution)
“Enumerator” (Problem)
“StructLayout” (Solution)
Math
Summary
Introduction
Attribution-NonCommercial-NoDerivatives 4.0 International
Powered By
GitBook
“StructLayout” (Problem)
What will the following code display?
1
public
struct
Foo
2
{
3
public
byte
Byte1
;
4
public
int
Int1
;
5
}
6
public
struct
Bar
7
{
8
public
byte
Byte1
;
9
public
byte
Byte2
;
10
public
byte
Byte3
;
11
public
byte
Byte4
;
12
public
int
Int1
;
13
}
14
void
Main
()
15
{
16
Console
.
WriteLine
(
Marshal
.
SizeOf
(
typeof
(
Foo
)));
17
Console
.
WriteLine
(
Marshal
.
SizeOf
(
typeof
(
Bar
)));
18
}
Copied!
Solution
Previous
ValueTypes
Next
“MutableProperty” (Solution)
Last modified
3yr ago
Copy link