Is this code is correct, I want to allocate memory from the stack..
using System;
using System.Globalization;
public class ABC{
static void Main(string[] args)
{
unsafe
{
char* i = stackalloc[256];
for (int j = 0; j < 256; j++)
i[j] = (char)j;
}
}
}
How to use stackalloc?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Apr 12, 2011, 12:10 AM EDT
char* i = stackalloc char[256];