L
Lint Radley
Hello,
I've been attempting to experiement with unsafe code in order to speed
up performance. I've read several examples online, including a Microsoft
one
All of the examples seem declare their pointers the way I have below.
However, when I try to I get the following errors all referring to the
int* line:
public unsafe class MyClass
{
int* test = stackalloc int [100];
.....
Invalid expression term 'stackalloc'
; expected
Array size cannot be specified in a variable declaration (try
initializing with a 'new' expression)
Invalid token ';' in class, struct, or interface member declaration
Allow unsafe code is turned on in the projects settings. I am using the
..NET 2.0 Framework.
Anyone have any ideas on where I am going wrong?
Thank you,
Lint Radley
I've been attempting to experiement with unsafe code in order to speed
up performance. I've read several examples online, including a Microsoft
one
All of the examples seem declare their pointers the way I have below.
However, when I try to I get the following errors all referring to the
int* line:
public unsafe class MyClass
{
int* test = stackalloc int [100];
.....
Invalid expression term 'stackalloc'
; expected
Array size cannot be specified in a variable declaration (try
initializing with a 'new' expression)
Invalid token ';' in class, struct, or interface member declaration
Allow unsafe code is turned on in the projects settings. I am using the
..NET 2.0 Framework.
Anyone have any ideas on where I am going wrong?
Thank you,
Lint Radley