Error while using stackalloc in C#
Hi,
I am working on a project in which i am writing unsafe code in few public methods in a public class. i declared the method as unsafe and added "using System.Runtime.InteropServices;" namespace as well but when i am building my solution i an getting this error:
1. Invalid expression term 'stackalloc'
2. ; expected
3. Invalid expression term 'byte'
4. ; expected
5. Invalid expression term ']'
The line where i am getting this error is:
char
* tmpPtr = (char*)stackallocbyte[(2 * 0x99)];Any help or advice to rectify the same is highly appreciated.
Thanks
Yogesh

